<?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: rex extration with double quotes in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391144#M113875</link>
    <description>&lt;P&gt;Are you trying to extract the numbers? If so then you can simply escape the quotes with a backslash &lt;/P&gt;

&lt;P&gt;Try the extraction below, the field-name will be ContactId&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex ContactId\"\:\"(?&amp;lt;ContactId&amp;gt;\d+)&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Aug 2018 00:50:30 GMT</pubDate>
    <dc:creator>skoelpin</dc:creator>
    <dc:date>2018-08-02T00:50:30Z</dc:date>
    <item>
      <title>rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391140#M113871</link>
      <description>&lt;P&gt;"ContactId":"12345"    and i have tried   rex  "\"ContactId\":\"(?[0-9]*)\""&lt;BR /&gt;
and no result..&lt;BR /&gt;
please help.. what did i do wrong with escape char \?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 22:54:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391140#M113871</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-01T22:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391141#M113872</link>
      <description>&lt;P&gt;sorry - this is not working - &lt;BR /&gt;
rex  "\"ContactId\":\"(?[0-9]*)\""&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 22:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391141#M113872</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-01T22:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391142#M113873</link>
      <description>&lt;P&gt;rex  "\"ContactId\":\"(?&amp;lt;ContactId&amp;gt;[a-zA-Z0-9-]*)\""   &lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 22:59:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391142#M113873</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-01T22:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391143#M113874</link>
      <description>&lt;P&gt;This looks mostly fine. I'd put the last &lt;CODE&gt;-&lt;/CODE&gt; in the square brackets at the front of the list, though:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "\"ContactId\":\"(?&amp;lt;ContactId&amp;gt;[-a-zA-Z0-9]*)\""
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Otherwise it seems fine. Do you also need to specify the field in this case? Sometimes that is needed to get it to work properly. There is just barely enough information about your problem to go on. This is a run-anywhere search that shows that it should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval data="\"ContactId\":\"12345\"" 
| rex field=data "\"ContactId\":\"(?&amp;lt;ContactId&amp;gt;[-a-zA-Z0-9]*)\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Aug 2018 23:26:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391143#M113874</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-08-01T23:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391144#M113875</link>
      <description>&lt;P&gt;Are you trying to extract the numbers? If so then you can simply escape the quotes with a backslash &lt;/P&gt;

&lt;P&gt;Try the extraction below, the field-name will be ContactId&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex ContactId\"\:\"(?&amp;lt;ContactId&amp;gt;\d+)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 00:50:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391144#M113875</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-08-02T00:50:30Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391145#M113876</link>
      <description>&lt;P&gt;Hey@mwibowo1,&lt;/P&gt;

&lt;P&gt;Can you try this:&lt;BR /&gt;
 rex field=_raw "\"ContactId\":\"(?P.*)\""&lt;BR /&gt;
Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 09:19:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391145#M113876</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-08-02T09:19:40Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391146#M113877</link>
      <description>&lt;P&gt;that is exactly what i am doing and it does not work..  &lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:24:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391146#M113877</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-02T16:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391147#M113878</link>
      <description>&lt;P&gt;You said you tried this and it didn't work?? You're regex is broken and doesn't capture the values whereas the solution I posted does.. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex "\"ContactId\":\"(?[0-9]*)\""&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;You're trying to extract the numbers? What doesn't work? Is it partially working? You need to add more context if you want any shot at getting this working&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:27:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391147#M113878</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-08-02T16:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391148#M113879</link>
      <description>&lt;P&gt;sorry - not working&lt;BR /&gt;&lt;BR /&gt;
| rex field=_raw "\"ContactId\":\"(?&amp;lt;ContactId&amp;gt;[a-zA-Z0-9-]*)\"" | table ContactId&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:36:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391148#M113879</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-02T16:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391149#M113880</link>
      <description>&lt;P&gt;sorry not working&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:40:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391149#M113880</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-02T16:40:43Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391150#M113881</link>
      <description>&lt;P&gt;does not work means when i do  | table ContactId   and it shows empty table (I know i have the data)&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 16:43:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391150#M113881</guid>
      <dc:creator>mwibowo1</dc:creator>
      <dc:date>2018-08-02T16:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391151#M113882</link>
      <description>&lt;P&gt;Does the run-anywhere search above work on your Splunk? If it doesn't, then you have something seriously odd going on. If it does, but the single line search above doesn't work, then your data doesn't look the way you have said, because each of the options that you have been given by the various contributors here should work. Look at your data carefully and figure out why it is not the same as what you have posted here.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391151#M113882</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2018-08-02T17:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: rex extration with double quotes</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391152#M113883</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;"ContactId\":"(.*?)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 17:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-extration-with-double-quotes/m-p/391152#M113883</guid>
      <dc:creator>pruthvikrishnap</dc:creator>
      <dc:date>2018-08-02T17:32:33Z</dc:date>
    </item>
  </channel>
</rss>

