Splunk Search

add seconds or minutes every 50000 events

efaundez
Path Finder

Good afternoon

Currently you try to index data to an index summary, but these events do not contain a timestamp so the indexing remains with the date the query was run.

This for splunk is a problem because there is no timestamp the data is indexed with the same timestamp and the query is truncated when you try to find it.

is there any method that allows you to add to a certain number of events plus seconds or minutes?

Best regards

0 Karma
1 Solution

manjunathmeti
Champion

Set _time = now() and add seconds every 50000 events:

<your_search> | eval _time=now(), count=1 | streamstats sum(count) as count | eval _time= _time + floor(count/50000)

If you want to add seconds to _time of each event then use this:

<your_search> | eval _time=now(), seconds=0.001 | streamstats sum(seconds) as seconds | eval _time=_time + seconds

View solution in original post

manjunathmeti
Champion

Set _time = now() and add seconds every 50000 events:

<your_search> | eval _time=now(), count=1 | streamstats sum(count) as count | eval _time= _time + floor(count/50000)

If you want to add seconds to _time of each event then use this:

<your_search> | eval _time=now(), seconds=0.001 | streamstats sum(seconds) as seconds | eval _time=_time + seconds

efaundez
Path Finder

it worked, thank you for your response.

Best regards

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...