Skip to main content
Sumo Logic

Timeslice Join Results

When you gather data using a join operation, you can slice data by time period using the timeslice operator. But to do so, you need to conduct the timeslice operation before the join

The timeslice operator uses the metadata field _messagetime to organize the logs by slices. In your query, you need to specify the timeslice operation before the join, because the _messagetime field will no longer exist after the join operation is performed.

When you add the timeslice before the join, each of the tables created by the join will now include a _timeslice field. 

You can reference the table's _timeslice field to use in your group by operation. The name of the table is appended to the the table's fields.

For example, if your table is named errors, your field would be errors__timeslice. (Notice that the name uses two underscores.)

Here's an example query:

*
| timeslice 1h
| join
(parse "starting stream from *" AS sId) AS T1,
(parse "starting search * from parent stream *" AS sId) AS T2
on T1.sId = T2.sId
| count T1_sId, T1__timeslice
| formatDate(fromMillis(T1__timeslice ), "MM/dd/yyyy HH:mm:ss z") as
timeslice