<?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: regex matched data only in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157810#M44454</link>
    <description>&lt;P&gt;awesome! thanks for the help.  is it possible to make the repid in regex _raw="repid=\d+" case insensitive? the reason is that there might be some cases of RepID or repiD, etc.&lt;/P&gt;</description>
    <pubDate>Fri, 09 May 2014 13:26:22 GMT</pubDate>
    <dc:creator>mkarimi</dc:creator>
    <dc:date>2014-05-09T13:26:22Z</dc:date>
    <item>
      <title>regex matched data only</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157808#M44452</link>
      <description>&lt;P&gt;I have a regex which looks for any event that has the repid=XXXX where XXXX is some number&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;"mysearch | rex repid=(?&amp;lt;REP_ID&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to display data that only matches that criteria.  for example none of these should be shown:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;repid
or 
repid=
or 
repid%s20=
or
repid-1245
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 May 2014 21:22:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157808#M44452</guid>
      <dc:creator>mkarimi</dc:creator>
      <dc:date>2014-05-08T21:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: regex matched data only</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157809#M44453</link>
      <description>&lt;P&gt;Your example is not valid, please avoid the confusion between : &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;the command "regex" that is used as a filter, and does not extract anything.&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;that would look like :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch repid | regex _raw="repid=\d+"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;or if the field is already extracted&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch repid | regex repid="\d+"&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;the command "rex" that is used to define field extractions not to filter&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;mysearch repid | rex "repid=(?&amp;lt;REP_ID&amp;gt;\d+)"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;here is a complex way to do it, but not really worth it&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;mysearch repid | rex "repid=(?&amp;lt;REP_ID&amp;gt;\d+)"  | fillnull REP_ID value="was not found" | where REP_ID!="was not found"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2014 22:11:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157809#M44453</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2014-05-08T22:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: regex matched data only</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157810#M44454</link>
      <description>&lt;P&gt;awesome! thanks for the help.  is it possible to make the repid in regex _raw="repid=\d+" case insensitive? the reason is that there might be some cases of RepID or repiD, etc.&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 13:26:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157810#M44454</guid>
      <dc:creator>mkarimi</dc:creator>
      <dc:date>2014-05-09T13:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: regex matched data only</title>
      <link>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157811#M44455</link>
      <description>&lt;P&gt;got that to by using (?i) in regex _raw="(?i)repid=\d+"&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2014 14:12:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/regex-matched-data-only/m-p/157811#M44455</guid>
      <dc:creator>mkarimi</dc:creator>
      <dc:date>2014-05-09T14:12:39Z</dc:date>
    </item>
  </channel>
</rss>

