Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kamal app logs: grep_options should be before grep pattern #1259

Open
dougireton opened this issue Nov 28, 2024 · 0 comments
Open

kamal app logs: grep_options should be before grep pattern #1259

dougireton opened this issue Nov 28, 2024 · 0 comments

Comments

@dougireton
Copy link

When running this command:

bundle exec kamal app logs -d staging --roles web --skip-timestamps --grep "Rails::HealthController" --grep-options "-v"

I get this error:

grep: grep_options: No such file or directory

Relevant Kamal code:

def logs(version: nil, since: nil, lines: nil, grep: nil, grep_options: nil)
  pipe \
    version ? container_id_for_version(version) : current_running_container_id,
    "xargs docker logs#{" --since #{since}" if since}#{" --tail #{lines}" if lines} 2>&1",
    ("grep '#{grep}'#{" #{grep_options}" if grep_options}" if grep)
end

grep_options should come before the grep pattern. Currently grep thinks the grep_options are a filename to search in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant