<?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 query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319015#M160036</link>
    <description>&lt;P&gt;Okay, reading what I can read, i don't see why it would succeed.  &lt;/P&gt;

&lt;P&gt;Your &lt;CODE&gt;rex&lt;/CODE&gt; is looking for a decimal number after (MQ) and before the =, which is not in your data. &lt;/P&gt;

&lt;P&gt;Something like this should pull the two fields...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "Notification Type \((?&amp;lt;NotifType&amp;gt;[^\)]*)\) = (?&amp;lt;TypeCode&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 18 Jul 2017 21:22:19 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-07-18T21:22:19Z</dc:date>
    <item>
      <title>Rex query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319013#M160034</link>
      <description>&lt;P&gt;For below input I tried search query as&lt;/P&gt;

&lt;P&gt;index=myindex "Notification"|rex "(MQ) (?\d+) = (?\w+)"|stats count(Notification)&lt;BR /&gt;
However, its not working says "no result found". The moment I take off ==&amp;gt; stats count(Notification)&lt;BR /&gt;
it shows values &lt;/P&gt;

&lt;P&gt;Input:&lt;BR /&gt;
[7/18/17 11:21:36:434 EDT] 00004b1d SystemOut O Notification Type (MQ) = EMAIL&lt;BR /&gt;
[7/18/17 11:21:36:434 EDT] 00004b1d SystemOut O Notification Type (MQ) = SMS&lt;BR /&gt;
[7/18/17 11:21:36:434 EDT] 00004b1d SystemOut O Notification Type (MQ) = VOICE&lt;BR /&gt;
Output&lt;/P&gt;

&lt;P&gt;Notification Type   TypeCode&lt;BR /&gt;
MQ                  EMAIL&lt;BR /&gt;
MQ                  SMS&lt;BR /&gt;
MQ                  VOICE&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 20:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319013#M160034</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2017-07-18T20:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Rex query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319014#M160035</link>
      <description>&lt;P&gt;You query is truncated. Please edit the question to add the query again and ensure that you select the query and click on button "101010" OR press Ctrl+K to format the code (to retains all formatting/content). Do the same for your raw data and output&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 21:07:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319014#M160035</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-07-18T21:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rex query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319015#M160036</link>
      <description>&lt;P&gt;Okay, reading what I can read, i don't see why it would succeed.  &lt;/P&gt;

&lt;P&gt;Your &lt;CODE&gt;rex&lt;/CODE&gt; is looking for a decimal number after (MQ) and before the =, which is not in your data. &lt;/P&gt;

&lt;P&gt;Something like this should pull the two fields...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex "Notification Type \((?&amp;lt;NotifType&amp;gt;[^\)]*)\) = (?&amp;lt;TypeCode&amp;gt;\w+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jul 2017 21:22:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319015#M160036</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-18T21:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rex query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319016#M160037</link>
      <description>&lt;P&gt;Thank you Jean. I figured out my mistake with your help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 11:01:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rex-query/m-p/319016#M160037</guid>
      <dc:creator>harishnpandey</dc:creator>
      <dc:date>2017-07-19T11:01:39Z</dc:date>
    </item>
  </channel>
</rss>

