<?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: Is this the correct way to extract successful and failed logins from /var/log/secure in a search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216702#M63623</link>
    <description>&lt;P&gt;@somesoni2 Awesome, thanks a lot but failed regex is added NULL user and I am unable to figure out.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 07:13:51 GMT</pubDate>
    <dc:creator>sureshsala</dc:creator>
    <dc:date>2016-04-20T07:13:51Z</dc:date>
    <item>
      <title>Is this the correct way to extract successful and failed logins from /var/log/secure in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216699#M63620</link>
      <description>&lt;P&gt;I need help with the regular expression for field extraction of login status:&lt;/P&gt;

&lt;P&gt;Successful: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/secure" | rex field=_raw " user (?[^ ]+)"| search user="*" | chart count BY host,user 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Failed: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/secure" | rex field=_raw " invalid user (?[^ ]+)"| search user="*" | chart count BY host,user 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is this the right way to do it, or there is a better way?&lt;/P&gt;

&lt;P&gt;Please help.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 14:02:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216699#M63620</guid>
      <dc:creator>sureshsala</dc:creator>
      <dc:date>2016-04-19T14:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Is this the correct way to extract successful and failed logins from /var/log/secure in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216700#M63621</link>
      <description>&lt;P&gt;What does the log entry look like? Can you share one event with successful logon and one with failed logon?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2016 18:18:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216700#M63621</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-04-19T18:18:09Z</dc:date>
    </item>
    <item>
      <title>Re: Is this the correct way to extract successful and failed logins from /var/log/secure in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216701#M63622</link>
      <description>&lt;P&gt;Assuming your regex is correctly extracting the users, I would try like this (I would always throw the index and sourcetype as well)&lt;/P&gt;

&lt;P&gt;Successfull &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype source="/var/log/secure" "session opened for user " | rex field=_raw "session opened for user (?&amp;lt;user&amp;gt;[^ ]+)"  | chart count BY host,user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Failed&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=yourIndex sourcetype=yourSourcetype  source="/var/log/secure" fail OR invalid | rex field=_raw " invalid user (?&amp;lt;user&amp;gt;[^ ]+)" | chart count BY host,user 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 19 Apr 2016 18:44:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216701#M63622</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-04-19T18:44:46Z</dc:date>
    </item>
    <item>
      <title>Re: Is this the correct way to extract successful and failed logins from /var/log/secure in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216702#M63623</link>
      <description>&lt;P&gt;@somesoni2 Awesome, thanks a lot but failed regex is added NULL user and I am unable to figure out.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 07:13:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216702#M63623</guid>
      <dc:creator>sureshsala</dc:creator>
      <dc:date>2016-04-20T07:13:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is this the correct way to extract successful and failed logins from /var/log/secure in a search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216703#M63624</link>
      <description>&lt;P&gt;Answer: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/secure" input_userauth_request AND (fail OR invalid) | rex field=_raw " invalid user (?[^ ]+)" | chart count BY host,user
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Apr 2016 08:01:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-this-the-correct-way-to-extract-successful-and-failed-logins/m-p/216703#M63624</guid>
      <dc:creator>sureshsala</dc:creator>
      <dc:date>2016-04-20T08:01:16Z</dc:date>
    </item>
  </channel>
</rss>

