Splunk Search

how to trim the values

john
Communicator

id=[ci.fif.3000-67777]
id=[fg.hki.4000-88888]

this the content of file i am working with from this i want only the values(3000 and 4000)please help.....

Tags (1)
0 Karma

Ayn
Legend

Extract the values as fields in Splunk. Quickest way is to use rex:

... | rex "\.(?<myvalue>\d+)-\d+\]"

This command creates a field myfield from your data when you include the command in your search.

0 Karma

john
Communicator

i got right value

0 Karma

john
Communicator

Thanks Ayn...

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...