Hello,
I’m trying to create visualizations for AWS WAF logs. So far the dashboard is working great, and most of the visualizations are working correctly.
But some of the visualizations which rely on scripted fields, are failing to be filtered.
By being filtered i mean the little + button inside the visualization (when filtering for a specific value).
So basically what happens when you click on that is that the script crashes and simply doesn’t display anything.
Below is the response with the reason why it failed
According the response the issue is within the compare() function, but its not a function that was written by me, i believe its the built-in function for the value filtering within the visualization.
The scripted field is User-Agent, and the script is as follows :
def header_name=‘’; for(int i=0; i<params._source.httpRequest.headers.length; i++) { header_name = params._source.httpRequest.headers[i].name.toLowerCase(); if (header_name == “user-agent”) { return params._source.httpRequest.headers[i].value } }
(I have to loop through the values because i cant reference them directly)
Does anyone has any idea why this happens?
*I’ve tried this on those versions of Kibana (6.7,6.8) and Opensearch 1.0 which are hosted on AWS Opensearch service.
Thanks in advance!