Cloudwatch Log Insights Query

0

I want to be able to filter the eventName of S3 by PutObject and CopyObject.

fields @timestamp, @message, @logStream, @log, detail.eventName
| sort @timestamp desc
| limit 1000
| filter detail.eventName in ["PutObject", "CopyObject"]

The above query only returns 1 result which I expect more

fields @timestamp, @message, @logStream, @log, detail.eventName
| sort @timestamp desc
| limit 1000
| filter detail.eventName in ["PutObject"]

Also returns one result

fields @timestamp, @message, @logStream, @log, detail.eventName
| sort @timestamp desc
| limit 1000
| filter detail.eventName="PutObject"

Returns a few result which is correct.

How do I set the filter so that the result returns EventName is either PutObject and CopyObject.

profile picture
Lottie
posta 2 mesi fa524 visualizzazioni
1 Risposta
1
Risposta accettata

Try this and let me know if it works:

fields @timestamp, @message, @logStream, @log, detail.eventName
| sort @timestamp desc
| limit 1000
| filter (detail.eventName="PutObject" or detail.eventName="CopyObject")
profile picture
ESPERTO
con risposta 2 mesi fa
profile picture
ESPERTO
verificato 2 mesi fa
  • Yes, it works! What didn't "in" work when applying it to the filter?

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande