Bar chart filtered by Day Of Week

Hi,

I am trying to create a bar chart that shows how many files were updated each day of the week. The column that has this data stores it as, for example, Wed Mar 15 14:01:22. How do I filter the data in this column to create a histogram for the frequency of file uploads on each day of the week? I.e., what aggregation/filters/json input would enable this?

Hello, you can use a scripted field for this.

In Kibana, go to Management > Index Patterns > Scripted fields > Add scripted field, and add a field like this:

doc['utc_time'].value.dayOfWeek part of the script returns the day of week in numerical form (e.g. 1 for Monday)

["", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"][doc['utc_time'].value.dayOfWeek] simply maps the numeric value to a human readable string

(change utc_time to the name of your time field)

Then, you can use this new field as a Terms aggregation in Visualize:

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.