Hi, I have a doc in ES with the number of events of Google Analytics and I want to create a visualization with the Average number of Events By Users. In the doc I have the field "email" and I would like to create a sort of script field:
Scripted fields only work on data in each individual docs, so you can't do counts and sums /day.
But there's lots of ways in Kibana to represent that data.
I don't have data with user emails, so I'm going to simulate that with my metricbeat data and let's pretend that these metricset.name values are your emails. This screenshot is from clicking on that field name in the Discover tab;
But if you want something by day, you could create a new visualization,
first select a Date Histogram
and then Split Series and do a Terms aggregation again on the same email field (I'm using metricset.name again).
Then set your timepicker in the top right corner (I set mine to last 7 days)
and set the interval in the Date Histogram to Daily instead of the default Auto
I think you have that inverted? If you want Average number of Events By Users. then you need the count of events for each user over the total count of all events. Otherwise users with very few events will have the largest result since you're putting it in the denominator.
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.