|
The file The file is not plain text, however, and contains binary data :
How can Splunk index the contents of that file? |
|
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). Then, there are two approaches you can take :
|
|
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. fwtmp takes wtmp(x) on standard input and produces lines like this on stdout:
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. |
