What is the best way to plot difference of particular field value at last monday and last to last monday in timelion?

Hi, I want to plot eg. on timelion or any other graph difference in values of particular field at interval of a week eg. let I have field count and I am getting data on daily basis, let there be another field name let's say three name are there X, Y Z each having value of count for each day.
Now I want to plot difference in value of count for each time for most recent monday which has passed and last to last most recent monday i.e. last week Monday to monday.

I found that offset can be given in timelion and that can be used if I want from today - 7 days this will be difference for pas 7 days, but I want for recent week which has passed i.e. fix either Sat to Sat or Sat to Monday like that.

Thanks

You can use the subtract function to view the differences between timeperiods

.es(index=kibana_sample_data_logs).subtract(.es(index=kibana_sample_data_logs,offset=-7d))

Hi @Nathan_Reese thank you for your response, I have already tried it. Actually this correctly gives the difference but what was looking is not any difference but specific last Monday data to last to last Monday data. The final graph will not have time on x axis but different field and y axis will have corresponding last Mon value -last to last Mon value.
Please do suggest what can be a good way to do the same.
Thank you
Saurabh

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