I am using the following search query in Kibana. Its returning the expected results. I am trying to aggregate vertical bar chart visualization using the script field. But the script fields "duration" and "state" isn't showing up in the drop down. Any idea why?
{
"index": "logs_test",
"query": {
"regexp": {
"body.message": ".* ended ."
}
},
"script_fields": {
"duration": {
"type": "double",
"script": {
"lang": "groovy",
"file": "extract_time"
}
},
"state": {
"type": "string",
"script": {
"lang": "groovy",
"file": "extract_state"
}
}
},
"filter": [],
"highlight": {
"pre_tags": [
"@kibana-highlighted-field@"
],
"post_tags": [
"@/kibana-highlighted-field@"
],
"fields": {
"": {}
},
"require_field_match": false,
"fragment_size": 2147483647
}
}