Splunk Search

How to assign a range in REGEX for filtering search results?

Madhan45
Path Finder
welcome to india : 0
welcome to india : 45
welcome to india : 123
welcome to india : 4999
welcome to india : 5000
welcome to india : 5001

Above are my input logs. I want to ignore an integer from 0 to 4999 in the string above. I need to get a result as below for the input. I tried with .*welcome to india : [0-4]?[0-9]?[0-9]?[0-9]?.*, but it didn't work.

welcome to india : 5000
welcome to india : 5001
Tags (4)
0 Karma

sundareshr
Legend

Try this

:\s([5-9]\d+)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

This regex will match integers from 5,000. If you only want 4 digits, change "{3,}" to "{3,4}".

"(welcome to india : [5-9][0-9]{3,})"
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...