I’d like to create a ‘timeseries-chart’ of totals, for example total number of cars per type, per month. Using ‘interval=30d’ gives me a ‘sliding window’ of totals per 30 days, not per month and not starting the first of every month. I want to get an overview of totals for Januari, Februari, Match etc.
This is possible, but requires some steps. Suppose your starting point is timeseries data with interval=24h. In this case, you would use three additional steps:
Transform your timeseries data to generate a separate record for each day. You can start with this DQL snippet and adapt to your needs.
Use the getMonth function to extract the month of the year into a new field.
Use the summarize command to generate totals by month and use this data as the basis for your visualization.
Because there is no ‘real’ timestamp anymore in the output, it is not possible to make a bar chart or something like that. The maketimeseries command would be the most obvious for my initial question, but then you cannot make totals per month.
getMonth() gives you only month number, which will not be nicely cartable on x-axis where we want to see actual time.
let’s start with simpler example where the source is not a metric, but event/logs/etc. If we introduce grouping by timeframes defined as full months using @ time alignment operator then bars will reflect full months: