Splunk Search

How to extract value with in brackets

kavyatim
Path Finder

Hi ,
I have data in the following format:
NOT_HOMOLOGATED-(UNKNOWN)
HOMOLOGATED-(Thomson SpeedTouch ST510 V6 versao 6.2.15.7 or ST585 v6)
NOT_HOMOLOGATED-(UNKNOWN)
HOMOLOGATED-(ZTE ZXDSL 831 II V7.5.02_E09_BR1)
NOT_HOMOLOGATED-(UNKNOWN)
NOT_HOMOLOGATED-(UNKNOWN)
HOMOLOGATED-(ZTE ZXDSL 831 II V7.5.02_E09_BR1)
HOMOLOGATED-(Thomson SpeedTouch ST510 V6 versao 6.2.15.7 or ST585 v6)
I would like to extract value with in the brackets i.e extracted values should be:
UNKNOWN
Thomson SpeedTouch ST510 V6 versao 6.2.15.7 or ST585 v6
UNKNOWN
ZTE ZXDSL 831 II V7.5.02_E09_BR1
and so on . . . . .

Can any one help me out in writing regex for this as it is not flexible with substring?

Thanking you in advance.

Tags (1)
0 Karma
1 Solution

MuS
Legend

Hi kavyatim,

something like

YourFancySearch | rex "\((?<myField>.*)\)" 

should work fine for you.
Here is a link to a page were you can test regex on your data.

hope this helps ...

cheers, MuS

View solution in original post

MuS
Legend

Hi kavyatim,

something like

YourFancySearch | rex "\((?<myField>.*)\)" 

should work fine for you.
Here is a link to a page were you can test regex on your data.

hope this helps ...

cheers, MuS

Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...