Actually it's not so hard to achieve. Here is another example, where I have added another Day 0 and some event dates inside and outside any day. | makeresults
| eval _raw="DATE,Start_Time,End_Time
...
See more...
Actually it's not so hard to achieve. Here is another example, where I have added another Day 0 and some event dates inside and outside any day. | makeresults
| eval _raw="DATE,Start_Time,End_Time
Day_3,2023-09-12 01:12:12.003,2023-09-13 01:13:13.993
Day_2,2023-09-11 01:11:11.002,2023-09-12 01:12:12.992
Day_1,2023-09-10 01:10:10.001,2023-09-11 01:11:11.991
Day_0,2023-09-04 01:12:12.000,2023-09-06 17:22:13.990"
| multikv forceheader=1
| table DATE Start_Time End_Time
| eval _time = strptime(Start_Time, "%F %T.%Q")
| eval end = strptime(End_Time, "%F %T.%Q"), start=_time
| append [
| makeresults
| eval _raw="Event type,Time,Others
EventID2,2023-09-11 01:20:20.133, ``` INSIDE DAY 2 ```
EventID1,2023-09-11 01:11:11.132, ``` INSIDE DAY 2 ```
EventID9,2023-09-10 01:20:30.131, ``` INSIDE DAY 1 ```
EventID3,2023-09-10 01:20:10.130, ``` INSIDE DAY 1 ```
EventID5,2023-09-10 01:10:20.129, ``` INSIDE DAY 1 ```
EventID1,2023-09-10 01:10:10.128, ``` INSIDE DAY 1 ```
EventID4,2023-09-07 01:10:10.127, ``` OUTSIDE ANY ```
EventID3,2023-09-06 06:10:10.126, ``` INSIDE DAY 0 ```
EventID2,2023-09-05 19:10:10.125, ``` INSIDE DAY 0 ```
EventID1,2023-09-04 04:10:10.124, ``` INSIDE DAY 0 ```
EventID0,2023-09-04 01:10:10.123," ``` OUTSIDE ANY ```
| multikv forceheader=1
| table Event_type Time
| eval _time = strptime(Time, "%F %T.%Q")
| eval eventTime=_time
| fields - Time
]
| sort _time
| filldown DATE start end
| eval eventIsInside=case(isnull(Event_type), "YES", isnotnull(Event_type) AND _time>=start AND _time<=end, "YES", 1==1, "NO")
| where eventIsInside="YES"
| stats values(*_Time) as *_Time list(Event_type) as eventIDs list(eventTime) as eventTimes by DATE
| eval eventTimes=strftime(eventTimes, "%F %T.%Q")
| table DATE Start_Time End_Time eventIDs eventTimes You can see that this works by making a common time, which is based on either start time or event time and then sorting by time. Setting start and end epoch times for the source 1 data means you can then 'filldown' those fields to subsequent event (source 2) rows until the next source 1 Day. Then as each event source 2 now has the preceeding day's start/end time, it can make the comparison for it's own time. Hope this helps.