Ignore weekends in timeline visualization in Kibana 7.10.2

I have a time series plot on my dashboard, which also includes a mvavg(10) trend line. I want to remove the weekends from the plot and all the calculations(since there is no data available for weekends).
I tried creating a scripted field(doc['timestamp'].value.getDayOfWeek()) for the same in my index to identify if it's a weekend and use that in a filter, however, the result I get after using that is just a straight line at 0.
Could someone please suggest a way to ignore weekends ?

Thanks,
Priyanka

You don't specify how you are creating your visualization but with lens this should work.

I've added a scripted field to get if my data point is on a weekend with this script:

def source = doc['timestamp'].value;

if (source == null){
  emit(false);
  return
}

def day_of_week = source.getDayOfWeek().getValue();
emit(day_of_week > 5)

Then created a Lens visualization with an average of a metric and moving average of the same average value

And now I can filter out the weekend data and I think everything looks OK, right?

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