Datadog Dashboard with a template variable

49 Views Asked by At

I have a dashboard in Datadog that uses a "status" variable to filter the log messages. This works fine for the majority of the entries.

'status' variable

There are some actual errors that do not have status=Error. They are logged as Info:

errors with status<>error

When I select "Error" from the variable dropdown I would like to get the entries with status=Error and any other entry (regardless of the status) which has the work "Error" as part of the content. If I select status="Debug" or status="Info" I would like to get the entries that match that status.

I can't figure out how to construct the query. Please, help.

This is how it is configured now (it will return log entries that have 'ERROR' even if I am interested in Debug entries only):

query definition

I tried different queries but they did not produce the result I wanted. I am new to datadog, so I am not sure how to construct the query.

1

There are 1 best solutions below

0
Alejandro Mejia On

In which language are you programming?

but if you are talking about QUERY , this can help you to extract all logs with Error Status and logs with other status, but contain the word "error" on its message

FROM 
  logs
WHERE
  status = 'Error' OR
  message LIKE '%ERROR%'
LIMIT 20

for other status values, you can remove

OR
  message LIKE '%ERROR%'