Cannot filter using the isValidIp function in CloudWatch
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 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
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.
| filter isValidIp(Host)
Hope that helps!
PutLogEvents with timeStamp in past breaks Cloudwatch Insightsasked a year ago
Log Subscription Filter To Opensearchasked 7 months ago
AWS step function giving error, when I had included the "Parameter" tagasked a month ago
Filtering CloudWatch Insights by timestamp with date rangeasked 2 years ago
Cannot filter using the isValidIp function in CloudWatchasked 2 months ago
CloudWatch-Insights: How to compare attributes on a queryasked a month ago
How can you filter by json property in cloudwatch log?asked 7 months ago
Run a Lambda function for RDS using the DBInstanceIdentifierasked 19 days ago
Can I use CloudWatch Logs to trigger a Lambda function?Accepted Answerasked 2 years ago
Start & Stop of EC2 instance using tags in Lambda functionAccepted Answerasked 3 months ago