Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to filter CloudWatch Log Insights with ispresent() function

I'm trying to perform a really simple query on the not so new AWS Cloudwatch Log Insights

I'm following their documentation to filter my logs using ispresent function.

The query is the following:

fields @timestamp, status
| filter ispresent(status) != 0

But this give me an error (the super unhelpful We are having trouble understanding the query)

How can I filter my logs by showing only the logs with the status field?

like image 677
Gustavo Lopes Avatar asked May 08 '19 19:05

Gustavo Lopes


People also ask

How do I filter CloudWatch logs by timestamp?

Filtering on timestamp is done with the range selector on the top right in the Logs Insights Console or with the startTime and endTime parameters on the StartQuery API.


1 Answers

The accepted answer doesn't work for me, but you can now negate ispresent():

fields @timestamp, status
| filter !ispresent(status)
like image 144
NateH06 Avatar answered Sep 20 '22 18:09

NateH06