I have a table which have column month, year and expenses_value. i have 12 month values in month column (e.g January, February, March etc). i have data from November 2017 to November 2018.
I have use logstash to insert data into elastic search.
now i am creating bar chart of this data.
i am taking expenses_value on y-axis ( aggregation>sum on expenses_value). and month on x-axis (aggregation>term on month field) and sub aggregation (aggregation>term on year field).
i have expenses_value of November 2017 and November 2018. now on visualization, it is showing a single bar of November 2017 and November 2018 (combine values of November 2017 and November 2018, separated by different color in November month bar).
i want to create separate bar of each month and order by month with year.
In your logstash pipeline, try to combine the year and month into the same field, which ideally would be mapped to the date datatype in the Elasticsearch index. You could then use a date_histogram in your visualisation.
To combine the fields, you could for example use add_field in the mutate plugin.
now separate bar showing for November 2017 and November 2018.
Its showing in this order:
2017-December
2017-November
2018-April
2018-August
2018-February
....
Can i sort the month wise data.
for example:
2018-November
2018-October
2018-September
..
....
2018-January
2017-December
2017-November
Thanks for trying this out. However, I had assumed that the month would be a number between 01 and 12, leading to combined values such as 2018-11, which is easily converted into a date field value.
Is there any chance that you get a simple timestamp out of your SQL database?
Sir,
i have add another column req_date. data type of this column is varchar in database which have date timestamp value.
like this:
For November-2017, req_date= 2017-11-30 00:00:00.000
For December-2017, req_date= 2017-12-31 00:00:00.000
For March-2018, req_date= 2018-03-31 00:00:00.000
Sir,
I have used this date filter:
date {
match => [ "req_date", "ISO8601", "YYYY-MM-dd", "YYYY-MM-dd" ]
target => "req_date"
locale => "en"
}
In database req_date column having a value: 2017-11-30 00:00:00.000
It is display on bar graph: November 30th 2017, 00:00:00.000
Can i display only November 2017 on bar graph in visualization.
If you mean that the number is displayed as text on top of the bar, this doesn't appear to be possible with the standard vertical bars visualisation. You can explore different settings in the Metric and Settings and Panel Settings tabs when you create the visualisation.
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.