Cannot filter using the isValidIp function in CloudWatch

0

Hi

I'm currently experiencing issues when trying to use the "isValidIp" function for filtering logs in CloudWatch

fields @timestamp, StatusCode, RequestPath, @@m, isValidIp(Host),!(isValidIp(Host))
| filter !(isValidIp(Host))

I expect the query above to filter all logs where "Host" is not a valid IP address, but nothing is being filtered. At the same time, I render isValidIp(Host) and !(isValidIp(Host)) and see that these can clearly render the correct values for the function.

Is there some limitation or is my syntax incorrect?

Here is a link to a screenshot of the query and results: https://ibb.co/NSM8qM3

질문됨 2년 전213회 조회
1개 답변
0

I couldn't see the screenshot you shared, so I'm guessing a little here...

IsValidIp will return a boolean (true if valid), so I think you will need to use it in a condition in filter.

For example

| filter isValidIp(Host)

Hope that helps!

AWS
AWS-SA
답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠