Splunk Search

Writing reqular expressions

Deepz2612
Explorer

Please help me in writing the regular expression for the below:

2017-11-17 14:20:03 DueDate="11/17/2017", Identifier="12244", ID Year="1887", ID name="Tool-Based", Pickup Contact Phone#="(123) 123-1234"

I wanted to write regular expressions for all the values that are within the Quotes.

Thanks in advance!

Tags (1)
0 Karma

niketn
Legend

These should ideally be extracted automatically during Search Time Field Discovery with KV_MODE=auto. Please validate props.conf for your sourcetype and test out with Verbose Search whether fields get automatically created or not.
Refer to documentation: https://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf

If you really want to do it during search time, you can try either KV command or extract command (with kvdelim="=" and pairdelim=","). Following is the run anywhere search based on sample data:
With extract command:

|  makeresults
|  eval _raw="2017-11-17 14:20:03 DueDate=\"11/17/2017\", Identifier=\"2G1WT57K691118585\", ID Year=\"2009\", ID name=\"Tool-Based\", Pickup Contact Phone#=\"(877) 273-5572\""
|  extract kvdelim="=" pairdelim=","

OR with KV

|  makeresults
|  eval _raw="2017-11-17 14:20:03 DueDate=\"11/17/2017\", Identifier=\"2G1WT57K691118585\", ID Year=\"2009\", ID name=\"Tool-Based\", Pickup Contact Phone#=\"(877) 273-5572\""
|  KV

Refer to documentation: https://docs.splunk.com/Documentation/Splunk/latest/Search/Extractfieldswithsearchcommands

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

niketn
Legend

@Deepz2612, can you please confirm whether the solution worked for you or not?

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
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 ...