amazon-cloudwatchaws-cloudwatch-log-insights

AWS Log Insights query with string contains


how do I query with contains string in AWS Log insights

fields @timestamp, @message
filter @message = "user not found"
| sort @timestamp desc
| limit 20

fields @timestamp, @message
filter @message strcontains("User not found")
| sort @timestamp desc
| limit 20

Solution

  • This should work fine

    fields @timestamp, @message
    | filter @message like /user not found/
    | sort @timestamp desc
    | limit 20