Timelion -1M offeset producing unexpected results

Hi,
What does -1M offset in Timelion translate to? Is it aware of calendar months or does it just translate to the number of days in the current month?

I have the Kibana time filter set to last month and the metric is a csum of a given field. I then chart -1M offset alongside the original chart which I was expecting to translate to the entire month of October and the last data point on the -1M chart shows a csum value which is not correct and different from a csum chart with the date filter set from October 1st to Oct 31st.

Can you clarify the expected behavior and how I can accomplish comparing / subtracting the csum of the entire month with that of it's previous month,

Thanks,
Sanjiv

The code for time offset is here, it's using the momentjs library. It takes the current month and adds/subtracts one. If the next month has more days, the day stays the same. If the next month has less days, it takes the maximum number of days in that month. October has one more day than September, so it may be possible September 30th is being counted twice. If you do October 1 to October 30 does the sum look correct?

Thanks for the explanation. The sum looks correct when selecting Oct 1 to Oct 30. This wasn't the behavior I was looking for but at least I know now the logic it's using.

Unfortunately this makes it less useful for the use cases I'm looking at. Ideally I would have liked the option (perhaps using a variation of the function offset) on a day of Dec 13 if I selected previous month the graph should display two line, one from Nov 1st to 30th, and the other going only from Dec 1st to the 13th. Same behavior with week and year offsets. This would be a lot more meaningful in terms of the comparison of numbers presented.

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