Splunk Search

extract no.

splunkuseradmin
Path Finder

hi all
I have events in json format need to extract number from this sip:+1234566@12.23.34.45
example: i need +1234566 from this any regex exp for this ..... field name is "Routing-Number"
thanks

Tags (1)
0 Karma
1 Solution

Vijeta
Influencer

You can use this

rex field=_raw "sip:(?<RoutingNumber>\S+)@"

View solution in original post

0 Karma

vinod94
Contributor

Dyude!

You can try this,

| makeresults 
| fields - _time 
| eval data="sip:+1234566@12.23.34.45" 
| rex field=data "sip\:\+(?P<Routing_Number>.*)\@"
0 Karma

vnravikumar
Champion

Hi

Try this rex,

| makeresults 
| eval test="sip:+1234566@12.23.34.45" 
| rex field=test "sip:(?P<RoutingNumber>[^@]+)"
0 Karma

vnravikumar
Champion

Hi

Try the above rex, which extracts the required string with a minimum steps

https://regex101.com/r/ULGqk2/1

0 Karma

Vijeta
Influencer

You can use this

rex field=_raw "sip:(?<RoutingNumber>\S+)@"
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...