Splunk Dev

Query criteria to calculate Time Span

sanjayiowa
New Member

Hi,

Is there a way to calculate a time span from start to stop position using java sdk.

e.g.
11012012 12:00:01 PM Start
...
....

11012012 12:30:01 PM Stop

and
result would be 30 min.

Thanks,
Sanjay

Tags (2)
0 Karma
1 Solution

alacercogitatus
SplunkTrust
SplunkTrust

If this log file is in Splunk, you could try:

search_foo | transaction host startswith="Start" endswith="Stop"

The resulting "duration" field will tell you how long it took.

http://www.splunk.com/base/Documentation/5.0/SearchReference/Transaction

View solution in original post

alacercogitatus
SplunkTrust
SplunkTrust

If this log file is in Splunk, you could try:

search_foo | transaction host startswith="Start" endswith="Stop"

The resulting "duration" field will tell you how long it took.

http://www.splunk.com/base/Documentation/5.0/SearchReference/Transaction

dwaddle
SplunkTrust
SplunkTrust

If the answer solved your problem, please click the check box to the left to "accept" the answer.

0 Karma

sanjayiowa
New Member

Thanks for prompt response. I was able to get desire result.

0 Karma

sanjayiowa
New Member

Those events are in a log file. I would like to get 30 min as answer or list of those time period if there are multiple Start/Stop (matching first to first)

0 Karma

alacercogitatus
SplunkTrust
SplunkTrust

Are you trying to parse this from events returned from a search? Where are you getting these times from?

0 Karma
Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...