<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Field extraction in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342523#M164292</link>
    <description>&lt;P&gt;Great!&lt;BR /&gt;
Thanks @niketnilay. this worked and thank you so much for helping me out.&lt;/P&gt;</description>
    <pubDate>Sun, 17 Dec 2017 13:48:26 GMT</pubDate>
    <dc:creator>Deepz2612</dc:creator>
    <dc:date>2017-12-17T13:48:26Z</dc:date>
    <item>
      <title>Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342519#M164288</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;

&lt;P&gt;For logs such as below please help me in extracting the data enclosed within double quotes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Contact Dealership Name="Amery",Role= "IT_Deal"
Contact Dealership Name="US",Role= "IT_Deal"
Contact Dealership Name="J. Nuckolls, Inc. dba Fenton Auto Sales",Role= "IT_DEAN"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried using rex field=_raw "Contact Dealership Name=\"(?[^,]+)\""&lt;BR /&gt;
But the results are as below :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Dealership_Name 
Amery
US
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but &lt;STRONG&gt;J. Nuckolls, Inc. dba Fenton Auto Sales&lt;/STRONG&gt; is not included in the result.&lt;BR /&gt;
how the rex_field has to be modified to capture that also&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 16:10:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342519#M164288</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2017-12-16T16:10:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342520#M164289</link>
      <description>&lt;P&gt;Try the following regex:&lt;/P&gt;

&lt;P&gt;Contact Dealership Name=\"(.+?)\"&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 16:29:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342520#M164289</guid>
      <dc:creator>ifotopoulos</dc:creator>
      <dc:date>2017-12-16T16:29:00Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342521#M164290</link>
      <description>&lt;P&gt;Hey @Deepz2612&lt;/P&gt;

&lt;P&gt;Try this, you will be able to extract dealership name and role in one regex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=_raw “Contact\sDealership\sName=(\"|\s)(?P&amp;lt;ContactDealershipName&amp;gt;[^\"]+)\",Role=(\s|)\"(?P&amp;lt;Role&amp;gt;[^\"]+)”
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Let me know if this works!&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2017 18:09:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342521#M164290</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-16T18:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342522#M164291</link>
      <description>&lt;P&gt;@mayurr98, &lt;CODE&gt;max_match=0&lt;/CODE&gt; needs to be added in case this is a single event. Contact Dealership Name does not have space after equal to sign and before double quotes. However Role has a space before double quotes. So, the following regex should also work.&lt;/P&gt;

&lt;P&gt;You have special character double quotes in the code above for regular expression convert to simple double quotes &lt;CODE&gt;"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;@Deepz2612, following is the run anywhere search based on your sample data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="Contact Dealership Name=\"Amery\",Role= \"IT_Deal\"
 Contact Dealership Name=\"US\",Role= \"IT_Deal\"
 Contact Dealership Name=\"J. Nuckolls, Inc. dba Fenton Auto Sales\",Role= \"IT_DEAN\"
"
| rex "Contact\sDealership\sName=\"(?&amp;lt;contact_dealership_name&amp;gt;[^\"]+)\",Role=\s\"(?&amp;lt;role&amp;gt;[^\"]+)\"" max_match=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Dec 2017 18:38:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342522#M164291</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-16T18:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342523#M164292</link>
      <description>&lt;P&gt;Great!&lt;BR /&gt;
Thanks @niketnilay. this worked and thank you so much for helping me out.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Dec 2017 13:48:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction/m-p/342523#M164292</guid>
      <dc:creator>Deepz2612</dc:creator>
      <dc:date>2017-12-17T13:48:26Z</dc:date>
    </item>
  </channel>
</rss>

