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

Add support for the columns filter in live tail #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion scalyr
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,11 @@ def liveTail(apiToken, args):
while current_time - start_time < maximum_tail_time:

# Send the query to the server.
columns = args.columns
if columns.find("sessions") == -1:
columns += ",session"
if columns.find("timestamp") == -1:
columns += ",timestamp"
response, rawResponse = sendRequest(args, '/api/query', {
"token": apiToken,
"queryType": "log",
Expand All @@ -442,7 +447,7 @@ def liveTail(apiToken, args):
"endTime": int(current_time),
"maxCount": max_matches,
"pageMode": "tail",
"columns": '',
"columns": columns,
"priority": "low"
})

Expand Down Expand Up @@ -486,6 +491,8 @@ def commandTail(parser):
help='specifies the format in which matching log messages are displayed')
parser.add_argument('--lines', '-n', type=int, default=10,
help='Output the previous \'n\' lines at the start of the tail')
parser.add_argument('--columns', default='',
help='comma-delimited list of columns to display; defaults to all')

# Get the API token
args = parser.parse_args()
Expand Down