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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...