0

Can you write a query for AWS Log Insights that would check 2 messages at a time?

What i am looking for is a pattern, where: message like /text1/ is followed by message like /text2/

can you have a query that will check for something like parse (message like text1 and message+1 like text2) as event stats count(event)

An example would be: "Info: API request for" followed by next message: Error: Invalid

This would allow me to count how many times a particular user made a request, that resulted in a particular error.

sorry for really bad syntax, it's a theory question, not sure if it's possible to do it. I appreciate all the help.

I have managed to count the specific errors, but was unable to tie them to a specific user, because the error and user are not logged in within the same log message.

The-Lomax
  • 106
  • 3
  • 2
    Generally not, that is not how Log Insights work, no. You always need all the relevant information in a single log statement / line / entry. – luk2302 May 30 '23 at 13:59
  • I was afraid that would be the case. I was hoping that someone might have come up with a workaround for this, and i could run the search retrospectively, rather than having to amend the log and wait for data to populate. Thank you for helping anyway! – The-Lomax May 30 '23 at 14:03

0 Answers0