<?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: Search to find the timestamp of each (Login, Logout, Expire) keyword from _raw and log file last updated time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490940#M137077</link>
    <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=serverlogs source=server*.log
| eval status=case(
   match(_raw, "Login",  "Login",
   match(_raw, "LogOut", "Logout", 
   match(_raw, "Expire", "Expire",
   true(), "Other")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 04 Oct 2019 02:09:56 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-10-04T02:09:56Z</dc:date>
    <item>
      <title>Search to find the timestamp of each (Login, Logout, Expire) keyword from _raw and log file last updated time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490938#M137075</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;Can anyone please help me in the below search.&lt;BR /&gt;
I want the name of all logfiles with details of keywords from each sourcetype.&lt;BR /&gt;
If there is a keyword present in the specific log file then the last time when that keyword was there in the log file.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Log_Name | Updatedago  | Login                                             |   Logout                                                | Expire&lt;BR /&gt;
Server.log  |                          Last Login event at "TimeFrame"| Last LogOut event at "TimeFrame"| Last Expire event at "TimeFrame"&lt;BR /&gt;
Server1.log |                         Last Login event at "TimeFrame"| Last LogOut event at "TimeFrame"| Last Expire event at "TimeFrame"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;The Login , Logout, Expire are the keywords available in _raw field.&lt;BR /&gt;
The timestamp field specifies the logs are updated how many minutes/hours ago(last updated time of log file)&lt;/P&gt;

&lt;P&gt;I am using below search but no results and not sure how to get last updated thing:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=serverlogs source=server*.log
 | eval status=if(_raw LIKE "*Login*" ,Login, _raw LIKE "*LogOut*","Logout", _raw LIKE "*Expire*","Expire",0 )
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Sep 2019 22:13:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490938#M137075</guid>
      <dc:creator>sahil237888</dc:creator>
      <dc:date>2019-09-27T22:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Search to find the timestamp of each (Login, Logout, Expire) keyword from _raw and log file last updated time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490939#M137076</link>
      <description>&lt;P&gt;Hi  sahil237888,&lt;BR /&gt;
whay don't you tried to use tags?&lt;BR /&gt;
you should create three different eventypes and associate to each of them a tag:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;CODE&gt;index=serverlogs source=server*.log login&lt;/CODE&gt; for tag=login&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;index=serverlogs source=server*.log logout&lt;/CODE&gt; for tag=logout&lt;/LI&gt;
&lt;LI&gt;&lt;CODE&gt;index=serverlogs source=server*.log logfail&lt;/CODE&gt; for tag=logfail&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;In this way, yoy have the keywords to display:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=serverlogs source=server*.log
| table _time source tag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Using this method I created an entire apps to display login, logout and logfail of many different systems, creating many eventyper (three for each kind of system) associating the related tag.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 28 Sep 2019 08:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490939#M137076</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-09-28T08:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Search to find the timestamp of each (Login, Logout, Expire) keyword from _raw and log file last updated time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490940#M137077</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=serverlogs source=server*.log
| eval status=case(
   match(_raw, "Login",  "Login",
   match(_raw, "LogOut", "Logout", 
   match(_raw, "Expire", "Expire",
   true(), "Other")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Oct 2019 02:09:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-to-find-the-timestamp-of-each-Login-Logout-Expire-keyword/m-p/490940#M137077</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-10-04T02:09:56Z</dc:date>
    </item>
  </channel>
</rss>

