Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not seeing any Fields for a non-Count Y-Axis aggregation

I'm trying to graph out average response time from http logs. When I go to Visualize and try either a bar or line graph, any time that select a different Aggregation type besides Count(ie Average, Sum, Max, etc), I never get any values in the Field drop down. I believe that the X-Axis should/could just be a Date Histogram.

My query looks like this: "host:'hostname' AND file:'access.log'", which generates a ton of results as a Count, but again, can't seem to figure out how to graph out that other trend over time(outside of a count). I can confirm all my fields are being indexed.

Thanks.

like image 578
Chris Munns Avatar asked Sep 29 '22 13:09

Chris Munns


1 Answers

The issue in this case came down to mappings, and how the fields were all being interpreted as strings, which makes it impossible to do any of the other number related Aggregations. The only way I found this out is via a tweet from Rashid(the lead dev of Kibana) tweet from Rashid to me.

Essentially, as documented in the grok docs, I needed to define the mapping type:

%{NUMBER:request_time}

Became:

%{NUMBER:request_time:float}

After re-indexing and re-mapping, now my fields are mapping to the right type, and now I can do number based aggregations.

like image 193
Chris Munns Avatar answered Oct 10 '22 19:10

Chris Munns