<?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: Extracting field with quotes doesnt seem to work. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463966#M130787</link>
    <description>&lt;P&gt;Nobody likes backslashes!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"line\":\"2020-04-03T12:24:54.589Z LCS {\\\"customer\\\":5,\\\"channel\\\":\\\"sqs\\\",\\\"notificationId\\\":213546}"
| rex "customer\\\\\":(?&amp;lt;customer&amp;gt;[^,]+),\\\\\"channel\\\\\":\\\\\"(?&amp;lt;channel&amp;gt;[^\\\]+)\\\\\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 03 Apr 2020 15:54:02 GMT</pubDate>
    <dc:creator>jpolvino</dc:creator>
    <dc:date>2020-04-03T15:54:02Z</dc:date>
    <item>
      <title>Extracting field with quotes doesnt seem to work.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463964#M130785</link>
      <description>&lt;P&gt;Here is the message in splunk and I am trying to extract customer and channel &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{"line":"2020-04-03T12:24:54.589Z LCS {\"customer\":5,\"channel\":\"sqs\",\"notificationId\":213546} 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run something like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=docker  "Exception" | rex "CustomerID: (?&amp;lt;customer&amp;gt;\S+)," |  rex "channelName\\\\\":\\\\\"(?&amp;lt;channel&amp;gt;\w+)"  | stats count(notificationId) by CustomerID 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am able to see the CustomerID extracted&lt;/P&gt;

&lt;P&gt;but when I do &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=docker  "Exception" | rex "CustomerID: (?&amp;lt;customer&amp;gt;\S+)," |  rex "channelName\\\\\":\\\\\"(?&amp;lt;channel&amp;gt;\w+)"  | stats count(notificationId) by CustomerID, channelName
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It is not displaying any results which tells me I am not extracting the channelName correctly. How can I fix this ?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:19:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463964#M130785</guid>
      <dc:creator>balash1979</dc:creator>
      <dc:date>2020-04-03T14:19:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting field with quotes doesnt seem to work.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463965#M130786</link>
      <description>&lt;P&gt;Neither of your regular expressions match the example data.  There is no "CustomerID:" string and no "channelName" string.  Please verify the data so we can help you.&lt;/P&gt;

&lt;P&gt;Escaping of '\' is unintuitive in &lt;CODE&gt;rex&lt;/CODE&gt;.  Experiment with the number of &lt;CODE&gt;\\&lt;/CODE&gt; used to get the desired results.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 14:51:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463965#M130786</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-03T14:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting field with quotes doesnt seem to work.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463966#M130787</link>
      <description>&lt;P&gt;Nobody likes backslashes!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults
| eval _raw="{\"line\":\"2020-04-03T12:24:54.589Z LCS {\\\"customer\\\":5,\\\"channel\\\":\\\"sqs\\\",\\\"notificationId\\\":213546}"
| rex "customer\\\\\":(?&amp;lt;customer&amp;gt;[^,]+),\\\\\"channel\\\\\":\\\\\"(?&amp;lt;channel&amp;gt;[^\\\]+)\\\\\""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 15:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463966#M130787</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-04-03T15:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting field with quotes doesnt seem to work.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463967#M130788</link>
      <description>&lt;P&gt;Never mind. I was looking at the wrong values.  Thanks for pointing it out.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 15:58:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463967#M130788</guid>
      <dc:creator>balash1979</dc:creator>
      <dc:date>2020-04-03T15:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting field with quotes doesnt seem to work.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463968#M130789</link>
      <description>&lt;P&gt;Your data has &lt;CODE&gt;channel&lt;/CODE&gt; but your &lt;CODE&gt;RegEx&lt;/CODE&gt; has &lt;CODE&gt;channelName&lt;/CODE&gt; so try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "channel\\\\\":\\\\\"(?&amp;lt;channel&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Apr 2020 17:30:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-field-with-quotes-doesnt-seem-to-work/m-p/463968#M130789</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-04-03T17:30:27Z</dc:date>
    </item>
  </channel>
</rss>

