<?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 issue, quite an interesting one, potential bug? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232361#M68916</link>
    <description>&lt;P&gt;Also, I want the value of the field, not the count of those fields.&lt;/P&gt;</description>
    <pubDate>Mon, 21 Nov 2016 04:03:08 GMT</pubDate>
    <dc:creator>mrgibbon</dc:creator>
    <dc:date>2016-11-21T04:03:08Z</dc:date>
    <item>
      <title>REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232355#M68910</link>
      <description>&lt;P&gt;Just wondering if anyone has ever seen this before?&lt;/P&gt;

&lt;P&gt;This is the data I’m extracting from:&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"Classic,Audit Failure",11/14/2016 9:32:27 AM,AD FS Auditing,516,-3,"The following user account has been locked out due to too many bad password attempts. Additional Data Activity ID: 00000000-0000-0000-0000-000000000000 User: sausages\Abel.Caine Client IP: 103.1.1.1,10.1.1.1 nBad Password Count: 4 nLast Bad Password Attempt: 11/14/2016"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;I’m trying to extract the bad password count.&lt;BR /&gt;
By all means, this should work:&lt;BR /&gt;
| rex "Password Count: (?P[^ \n]+)"&lt;/P&gt;

&lt;P&gt;But it appears that Splunk sees the string ‘Count’ as a command, not just a string.&lt;BR /&gt;
I get the total ‘count’ of those fields it finds. &lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2153iCA981ECE8D39FEA4/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I’ve tried escaping it, using “\s{1}\w{6}” and a load of others things.&lt;/P&gt;

&lt;P&gt;Seen this before?&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 01:11:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232355#M68910</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-11-18T01:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232356#M68911</link>
      <description>&lt;P&gt;Hi mrgibbon &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;works like a charm on Splunk 6.5.0:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| gentimes start=-1 
| eval gibbon="\"Classic,Audit Failure\",11/14/2016 9:32:27 AM,AD FS Auditing,516,-3,\"The following user account has been locked out due to too many bad password attempts. Additional Data Activity ID: 00000000-0000-0000-0000-000000000000 User: sausages\Abel.Caine Client IP: 103.1.1.1,10.1.1.1 nBad Password Count: 4 nLast Bad Password Attempt: 11/14/2016\"" 
| rex field=gibbon "Password Count: (?P&amp;lt;count&amp;gt;[^ \n]+)" 
| table count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here is the result:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/2152i45D5552FCEF14DE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Can you please add the complete search you are running?&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 01:59:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232356#M68911</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-11-18T01:59:39Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232357#M68912</link>
      <description>&lt;P&gt;Hmm, Im using 6.5.0.&lt;BR /&gt;
Might be something quirky in the way the event is ingested, its only ADFS logs though, fairly std.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=adfs "Event ID"=403 OR "Event ID"=516 NOT "Audit Success" 
| rex "blah.internal\\\(?P[^ \n]+)" 
| rex "Activity ID: (?P[^\n \"]+)"
| rex "((\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}).+?(?P\\d{1,3}\.\\d{1,3}\.\\d{1,3}\.\\d{1,3}))"
| rex "nBad Password\s{1}\w{5}\:\s(?P[^ \n]+)" 
| rex "nLast Bad Password Attempt: (?P[^\"]+)" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is just one variation I have tried, of course I have tried the most basic one I listed first.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 02:30:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232357#M68912</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-11-18T02:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232358#M68913</link>
      <description>&lt;P&gt;Can you use the &lt;CODE&gt;code&lt;/CODE&gt; function so the named capturing groups are still in the search, please? &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 02:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232358#M68913</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-11-18T02:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232359#M68914</link>
      <description>&lt;P&gt;Why the &lt;CODE&gt;\n&lt;/CODE&gt;? Seems to me you only need &lt;CODE&gt;[^ ]&lt;/CODE&gt;+&lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 21:32:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232359#M68914</guid>
      <dc:creator>wrangler2x</dc:creator>
      <dc:date>2016-11-18T21:32:59Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232360#M68915</link>
      <description>&lt;P&gt;I added it in as when I view the event that number is actually below the leading text, like this:&lt;BR /&gt;
nBad Password Count: &lt;BR /&gt;
4&lt;/P&gt;

&lt;P&gt;So I added it in to cope with that, but if you copy out the event its directly following the colon and a space. I have tried without it, still the same result.&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 04:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232360#M68915</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-11-21T04:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232361#M68916</link>
      <description>&lt;P&gt;Also, I want the value of the field, not the count of those fields.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 04:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232361#M68916</guid>
      <dc:creator>mrgibbon</dc:creator>
      <dc:date>2016-11-21T04:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232362#M68917</link>
      <description>&lt;P&gt;Hi mrgibbon, you know how to reach me - Can you send some sample data and the search and I will have a look at it &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Cheers, MuS&lt;/P&gt;</description>
      <pubDate>Mon, 21 Nov 2016 05:22:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232362#M68917</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-11-21T05:22:09Z</dc:date>
    </item>
    <item>
      <title>Re: REX issue, quite an interesting one, potential bug?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232363#M68918</link>
      <description>&lt;P&gt;This works fine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex "Password Count:\s*(?&amp;lt;Count&amp;gt;\d+)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Mar 2017 06:55:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-issue-quite-an-interesting-one-potential-bug/m-p/232363#M68918</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-25T06:55:25Z</dc:date>
    </item>
  </channel>
</rss>

