All Apps and Add-ons

Greater than filter

lanode
Path Finder

This is a record from within my splunk index.

11/01/12 13:03 214 0004 1234567890 00:01'36

It is a call record from our PBX and the final part 00:01'36 shows the call duration. (Hr:Min'Sec)

I am trying to construct a filter that displays ALL records that have a duration greater than 00:00'30 or 30 seconds and am struggling to do this.

Any help would be much appreciated.

0 Karma
1 Solution

sowings
Splunk Employee
Splunk Employee

I would begin by creating a regular expression to capture hour, min, and second of that record, then perform eval math (sec + (60 * (min + (60 * hour)))), then sort by the new field.

View solution in original post

0 Karma

lanode
Path Finder

I have found a suitable solution to this problem.
Using the suggested regualr expression tool at - http://gskinner.com/RegExr/ - I was able to quickly formulate a regex that identified the required 'duration' characters within each record and then select only those records that exceeded a specified 'duration'.

So a big thank you to 'sowings' for their help.

Very much appreciated.

0 Karma

lanode
Path Finder

Great! - Thanks, I will investigate further

0 Karma

sowings
Splunk Employee
Splunk Employee

There is a regular expression tool at http://gskinner.com/RegExr/, you can try it directly. A regex for what you want might look like (?<hour>\d{2}):(?<min>\d{2})'(?<sec>\d{2})$. The $ means "anchored at the end of the line".

lanode
Path Finder

Thank you for your quick repsonse.

You say you would begin by creating a regular expression to capture hour, min and second of the record.

Part of the problem I'm wrestling with is the construction of such an expression.

Any pointers would be most greatfully received.

0 Karma

sowings
Splunk Employee
Splunk Employee

I would begin by creating a regular expression to capture hour, min, and second of that record, then perform eval math (sec + (60 * (min + (60 * hour)))), then sort by the new field.

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...