Splunk Search

How to extract a field value which have combination of number and special characters?

akarivaratharaj
Communicator

I have a field which have values only with numbers and also with combination of number and special characters as values. I would like to filter the field values where both number and special characters are in it.

Example:
Log 1 -> field1="238_345$345"

Log 2 -> field1="+739-8883

Log 3 -> field1="542.789#298"

Already I have tried in writing regex query but there is no expression to filter out the combination of digits & special characters. (No expression to filter all the special character).

How can I filter and display the field value which have the combination of number and special characters? Could anyone help me on this?

Labels (2)
0 Karma

SinghK
Builder
[+\-0-9#$%^!._?@]

 character class 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Are you sure you want _any_ special character? How do you even define a special character in this case?

I'd rather go either for any non-space character and use

\S

or explicitly define set of acceptable character using character class. Like

[-0-9#$%^!.?@]
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...