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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...