Scripted Fields not showing up in visualizations

Hi, I am attempting to create a dashboard based off a scripted field. The scripted field is a pretty simple boolean evaluation, and I tested the expression using the preview results feature. The visualization I am attempting to make is a line graph and I am trying to split the series by this field that I created. However, the scripted field does not show up in the Terms or Significant Terms sub aggregations. I double checked and the visualization and scripted field are both created on the same index pattern. Does anyone know what might be going wrong?

Which kibana version are you using? Are you using Lens or aggregation based visualizations? Also can you send the painless code that you generated your script?

I am not sure what kibana version Im using, I went to the management app but I cant find an "About" tab or a version listed anywhere. I am using aggregation based visualizations. Here is the painless script:

if (doc.containsKey('headers.user-agent')){
    return doc['headers.user-agent'].equals('CompanyAPI/1.0')
    return false

The version appears in the top right corner

To preview that the script has created successfully you can go to the "Get help with the syntax..." and check the preview results

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.