I have a line graph that shows number of logins today. What I want to do is overlay the average number of logins over the last 30 days. Is that possible? I figure I'll have to use another graph element on canvas and put them on top of each other, but I cant figure out what the SQL would be.
This is my current SQL for today:
SELECT name, data, date FROM index WHERE QUERY('name:visit') AND date > TODAY() ORDER BY date
That give me data from 00:00 to what ever time it is right now. So I only want averages for that period too, say 00:00 - 8am.
Yes, Timelion should work in Canvas. I'm going to open a ticket to unmask the error messages we are getting back as I have also noticed recently that this is a very unhelpful message. If you post your query we can take a look and see if we notice what the error could be.
@samgs You might be able to achieve what you want using ES SQL if I've got your problem right.
Here's an example using the kibana flights sample data that displays the number of flights per day between 00:00 and 08:00 for the past 30 days:
filters
| essql
query="SELECT Histogram(timestamp, INTERVAL 1 DAY) as date, count(*) as number_of_flights
FROM \"kibana_sample_data_flights\"
WHERE timestamp < TODAY()
AND timestamp >= TODAY() - INTERVAL 30 DAYS
AND HOUR_OF_DAY(timestamp) >= 0
AND HOUR_OF_DAY(timestamp) <= 8
GROUP BY date
ORDER BY date"
| table
| render
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.