Has anyone been able to successfully replicate and visualize concurrency in data in Kibana 5.x?
I have start, end, and duration timestamps in each message and I'm trying to follow directions in the post from 2015 but getting a an error in Kibana which doesn't show what the problem is.
@weltenwort,
Elasticsearch throws this error:
"Variable [start] is not defined."
This is the script the option that I"m adding to Advanced Json in Kibana:
{
"script": "start = doc['netflow']['StartSecondsMilliseconds'].value;
duration = doc['netflow']['flow_duration'].value * 1000;
l = [];
for (long i = 0; i < duration; i += 60000) { l.add(start + i); };
return l;"
}
Ah, it looks like you're still trying to use the old groovy script syntax. Starting with 5.0, Elasticsearch has introduced "painless" as the default scripting language. You could express that snippet in painless like this:
I guessed the end field name above, so it might not be 100% applicable to your scenario. But I hope this gives you an idea. I'd be happy to give more specific advice if you share more of your data schema.
That was it, now I'm back to elasticsearch throwing errors: Caused by: java.lang.IllegalArgumentException: No field found for [netflow.StartSecondsMilliseconds] in mapping with types []
It looks like the assumptions I made about the field names are incorrect. Would it be possible for you to post the index mapping (obtained via GET /${INDEXNAME}/_mapping)?
It seems there are still some incorrect assumptions about the document values and mapping types in the code. Having a sample of the documents (the netflow.flowStartMilliseconds and netflow.flowEndMilliseconds) would be helpful. Also, looking back at the mapping snippet, it looks like the two field definitions should be nested inside a properties key under netflow. Maybe you could provide a more complete sample of that as well?
Ok, it seems to be a combination of a date type error and the fact that returning arrays in inline scripts does not work anymore. I have gotten it to work using the following scripted field definition though:
@weltenwort,
Thanks! That worked well. But is there any way to use a different value for stepSeconds. I have a field called netflow.flow_duration that I want to use instead of static value of 60;
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.