<?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: How do I deal with Linux auth.log &amp;quot;Last Message Repeated&amp;quot; log lines when trying to get a count of identical events over a time period. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276656#M83460</link>
    <description>&lt;P&gt;How about like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/authlog" | rex "Last\s+message\s+repeated\s+(?&amp;lt;repeatsNoContext&amp;gt;\d+)\s+times." | fillnull value=0 repeatsNoContext | autoregress repeatsNoContext AS repeatsForMe | eval myCount= 1 + repeatsForMe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will cause every event to have a field &lt;CODE&gt;myCount&lt;/CODE&gt; that is correct.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Dec 2015 02:07:18 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-12-13T02:07:18Z</dc:date>
    <item>
      <title>How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276652#M83456</link>
      <description>&lt;P&gt;I'm trying to read in some logs on a Solaris system to check for users failing a login N times over Y seconds.    Currently I'm just looking for the log entry that tells me an account was locked out, but I'm trying to get more granular than that.  This should be pretty easy, but Solaris and other Linux systems make it difficult by condensing log entries.  So an example log might look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[time] User XXX failed login.
[time + 20] Last message repeated 1 times.
[time + 30] User ZZZ failed login.
[time + 31] User XXX failed login.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In this case user XXX failed his login three times quickly, and I'd like to be able to search for that.  I'm wondering if anyone can think of a way to do it.  I've tried using transactions, but they only have a start and end search, not a required middle.  My search using transactions is below.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/authlog" | transaction maxspan=20s maxevents=2 startswith="failed" endswith="last message repeated"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;From that sample log the search would pull the following parts of the log into one event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[time] User XXX failed login.
[time + 20] Last message repeated 1 times.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think I need some way to grab all three lines; maybe there's another method I'm unaware of?  If it's just not possible I can accept that as an answer too.&lt;/P&gt;

&lt;P&gt;If it helps at all, Solaris only condenses logs for about 20 seconds before printing out the whole line again.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 16:57:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276652#M83456</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-12-10T16:57:40Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276653#M83457</link>
      <description>&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/256730/how-can-i-make-the-splunk-app-for-pci-compliance-c.html"&gt;Unanswered potential duplicate.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 16:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276653#M83457</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-12-10T16:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276654#M83458</link>
      <description>&lt;P&gt;How about something like this. Assuming all events are time-stamped correctly&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* "failed login" | rex "User\s(?&amp;lt;user&amp;gt;\w+)" | timechart span=Ys list(user) as users count | where count&amp;gt;=N
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If they aren't time-stamped, then we will need to calculate the time, something like this is worth trying&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=* sourcetype=* "failed login" | rex "^\[(?&amp;lt;time&amp;gt;time)" | rex "\+\s(?&amp;lt;offset&amp;gt;\d+)" | eval time=strftime(strptim(time, directives)+offset, directives) | rex "User\s(?&amp;lt;user&amp;gt;\w+)" | bin span=Ys time | chart list(user) as users count by time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;directives - &lt;A href="http://strftime.org/"&gt;http://strftime.org/&lt;/A&gt;&lt;BR /&gt;
str?time - &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/Commonevalfunctions"&gt;http://docs.splunk.com/Documentation/Splunk/6.1/SearchReference/Commonevalfunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 22:05:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276654#M83458</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-10T22:05:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276655#M83459</link>
      <description>&lt;P&gt;Everything is time-stamped.  I was just trying to make the example match a general case.  A real example from my logs might be:&lt;BR /&gt;
    Dec  11 05:30:46 myServerName sshd[16484]: [ID 800047 auth.notice] Failed keyboard-interactive for myUserName from 232.181.212.242 port 50908 ssh2&lt;BR /&gt;
    Dec 11 05:31:03 myServerName last message repeated 2 times&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2015 13:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276655#M83459</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-12-11T13:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276656#M83460</link>
      <description>&lt;P&gt;How about like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/var/log/authlog" | rex "Last\s+message\s+repeated\s+(?&amp;lt;repeatsNoContext&amp;gt;\d+)\s+times." | fillnull value=0 repeatsNoContext | autoregress repeatsNoContext AS repeatsForMe | eval myCount= 1 + repeatsForMe
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will cause every event to have a field &lt;CODE&gt;myCount&lt;/CODE&gt; that is correct.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 02:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276656#M83460</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-12-13T02:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276657#M83461</link>
      <description>&lt;P&gt;I wrote that duplicate. Splunk works well with 1 line 1 timestamp per event. You can of course extract that integer. But this kind of solaris condensed log doesnt easily fit the splunk/CIM/ES/PCI way of doing things. &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/256730/how-can-i-make-the-splunk-app-for-pci-compliance-c.html"&gt;https://answers.splunk.com/answers/256730/how-can-i-make-the-splunk-app-for-pci-compliance-c.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 03:13:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276657#M83461</guid>
      <dc:creator>hylam</dc:creator>
      <dc:date>2015-12-13T03:13:12Z</dc:date>
    </item>
    <item>
      <title>Re: How do I deal with Linux auth.log "Last Message Repeated" log lines when trying to get a count of identical events over a time period.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276658#M83462</link>
      <description>&lt;P&gt;plz see my comment to the question&lt;/P&gt;</description>
      <pubDate>Sun, 13 Dec 2015 12:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-deal-with-Linux-auth-log-quot-Last-Message-Repeated/m-p/276658#M83462</guid>
      <dc:creator>hylam</dc:creator>
      <dc:date>2015-12-13T12:39:18Z</dc:date>
    </item>
  </channel>
</rss>

