Kibana: Create Term panels with date fields (Weekday, Month, Year, etc)?


(Gabriel Birke) #1

I have data with a field called "created_on" with "type":"date" in
Elasticsearch (format is date_time_no_millis). Is it possible to create
term panels that show "year", "month" or "weekday" terms?

If that's not possible I imagine I could create a mapping for the
"created_on" field that defines sub-fields like "created_on.month",
"created_on.weekday", etc. Can anyone give me an example on how such a
mapping would look like?

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/c8c64863-4a34-48b9-b7c4-2ef5bfc2da52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(j s) #2

I am not sure what are you using for ingesting data, if you are using Logstash you can use filter Date and then add terms weekday, month etc like this

date {
match => ["starttime", "YYYY-MM-dd HH:mm:ss"]
timezone => "UTC"
target => "@timestamp"
add_field => {"[weekday]" => "%{+EEEEE}"}
add_field => {"[month]" => "%{+MMM}"}
add_field => {"[year]" => "%{+yyyy}"}

  }

(system) #3