<?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: Can I Splunk my wtmp files? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34435#M6242</link>
    <description>&lt;P&gt;Hi Hexx,  Got a request to monitor the wtmpx file in splunk, but I am not sure how to create a script to read and write the data from wtmpx file  from  /var/adm/wtmpx and output the data into a text file, which splunk can read it. If you can guide me on creating a script, it will be great help.&lt;/P&gt;

&lt;P&gt;thanks in advance. &lt;/P&gt;</description>
    <pubDate>Wed, 07 Feb 2018 11:10:57 GMT</pubDate>
    <dc:creator>Hemnaath</dc:creator>
    <dc:date>2018-02-07T11:10:57Z</dc:date>
    <item>
      <title>Can I Splunk my wtmp files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34432#M6239</link>
      <description>&lt;P&gt;The file &lt;CODE&gt;/var/log/wtmp&lt;/CODE&gt; is where most *nix systems keep track of all logins and logouts to the system.&lt;/P&gt;

&lt;P&gt;The file is not plain text, however, and contains binary data :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@dirtysanchez ~]# file /var/log/wtmp  
/var/log/wtmp: data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How can Splunk index the contents of that file?&lt;/P&gt;</description>
      <pubDate>Fri, 20 Aug 2010 20:20:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34432#M6239</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2010-08-20T20:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Splunk my wtmp files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34433#M6240</link>
      <description>&lt;P&gt;The first thing to do is to convert the file contents to text. For /var/log/wtmp, this will typically be achieved using the "who" and "last" commands, depending on if you want historical data (last) or current data (who).&lt;/P&gt;

&lt;P&gt;Then, there are two approaches you can take :&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Set up a scripted input calling a shell script that executes "who" or "last" with the options you need and that will index the generated output. This is the simplest approach.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Write a shell script external to Splunk that periodically reads /var/log/wtmp and writes it's output to a file monitored by Splunk. This can be more elaborate since "last" doesn't have tailing or time span selection capabilities, but advanced shell scripting and cron can be used to set this up.&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Fri, 20 Aug 2010 20:35:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34433#M6240</guid>
      <dc:creator>hexx</dc:creator>
      <dc:date>2010-08-20T20:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Splunk my wtmp files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34434#M6241</link>
      <description>&lt;P&gt;It's somewhat easier to convert wtmp to text using fwtmp, which is specifically designed for the purpose. On solaris, it's in /usr/lib/acct; on most linux systems, it's part of the acct (GNU account tools) package.&lt;/P&gt;

&lt;P&gt;fwtmp takes wtmp(x) on standard input and produces lines like this on stdout:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;pde                                   sshd                                 12173  8 0000 0000 1282333385 148991 0 0  Fri Aug 20 19:43:05 2010
pde                                   sshd                                 14663  7 0000 0000 1282340448 321800 0 39 adsl-68-92-27-201.dsl.rcsntx.swbell.net Fri Aug 20 21:40:48 2010
pde                              ts/7 pts/7                                14667  7 0000 0000 1282340448 515234 0 39 adsl-68-92-27-201.dsl.rcsntx.swbell.net Fri Aug 20 21:40:48 2010
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since the wtmp format is well documented, it should be a fairly trivial exercise to extract the information you require from the text representation of the records.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Aug 2010 05:04:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34434#M6241</guid>
      <dc:creator>pde</dc:creator>
      <dc:date>2010-08-21T05:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Splunk my wtmp files?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34435#M6242</link>
      <description>&lt;P&gt;Hi Hexx,  Got a request to monitor the wtmpx file in splunk, but I am not sure how to create a script to read and write the data from wtmpx file  from  /var/adm/wtmpx and output the data into a text file, which splunk can read it. If you can guide me on creating a script, it will be great help.&lt;/P&gt;

&lt;P&gt;thanks in advance. &lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 11:10:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Splunk-my-wtmp-files/m-p/34435#M6242</guid>
      <dc:creator>Hemnaath</dc:creator>
      <dc:date>2018-02-07T11:10:57Z</dc:date>
    </item>
  </channel>
</rss>

