Splunk Search

How do I extract and compare numeric values from a Search result?

anirbanukil
Explorer

Log:

2011-09-28 16:13:12,399 INFO   [ProxyImpl] [INT1] [Interface] Time taken by Call: 743 milliseconds

Requirement: extract the numeric value (743 here) and compare with some threshold value (say 800)

Tags (2)
1 Solution

dwaddle
SplunkTrust
SplunkTrust

The most expedient way of doing this is with the rex and where commands. You can write a search similar to:

... | rex "Time taken by Call: (?<call_time>\d+) milliseconds"
| where call_time > 800

The rex command can be replaced with a permanent field extraction defined in props.conf and transforms.conf.

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

The most expedient way of doing this is with the rex and where commands. You can write a search similar to:

... | rex "Time taken by Call: (?<call_time>\d+) milliseconds"
| where call_time > 800

The rex command can be replaced with a permanent field extraction defined in props.conf and transforms.conf.

anirbanukil
Explorer

Thanks a lot.... It worked...

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 ...