How to split all the timestamps to a few groups of specfic period in time series dataframe


I am currently dealing with time series data fields.

But I need to build a dashboard in grafana where the based on specific time element values responds to different field values.

can you suggest a way whereby I can split the data automatically based on the event duration once the elasped time is more than few seconds then It should be regards as new state event and based on that I can query other fields.

Looking forward to hearing your suggestion.