<?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 Time Conversion and indexing in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93594#M22686</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;We index logfiles which have date time strings on the beginning of each event in hex format.&lt;/P&gt;

&lt;P&gt;50FD316C = Mon Jan 21 13:15:40 2013&lt;/P&gt;

&lt;P&gt;Is it possible to change this hex datetimestamp to an readable timestamp with default splunk features?&lt;/P&gt;

&lt;P&gt;Or is it possible to execute a script on each event and change this timestamps in the _raw field?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Rob&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jan 2013 14:44:11 GMT</pubDate>
    <dc:creator>RobertRi</dc:creator>
    <dc:date>2013-01-21T14:44:11Z</dc:date>
    <item>
      <title>Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93594#M22686</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;We index logfiles which have date time strings on the beginning of each event in hex format.&lt;/P&gt;

&lt;P&gt;50FD316C = Mon Jan 21 13:15:40 2013&lt;/P&gt;

&lt;P&gt;Is it possible to change this hex datetimestamp to an readable timestamp with default splunk features?&lt;/P&gt;

&lt;P&gt;Or is it possible to execute a script on each event and change this timestamps in the _raw field?&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Rob&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 14:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93594#M22686</guid>
      <dc:creator>RobertRi</dc:creator>
      <dc:date>2013-01-21T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93595#M22687</link>
      <description>&lt;P&gt;Do you want to use the hex code as the timestamp for the event ?&lt;BR /&gt;
Thats not possible without pre-processing the event beforehand ( before splunk sees it )&lt;/P&gt;

&lt;P&gt;If all you want to do is convert the code to a readable time after the event has been indexed then assuming the field you want to convert is called 'hex_time'&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval my_time=tonumber(hex_field,16) | convert ctime(my_time) | table my_time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;1st part converts the hex to epoch seconds&lt;BR /&gt;&lt;BR /&gt;
2nd part formats the time into a readable date format&lt;/P&gt;

&lt;P&gt;If the 'hex_field' is not automatically extracted, this'll do it (based on the fact the hex is at the start of the line) :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex ^(?&amp;lt;hex_field&amp;gt;\S+) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;If you need to convert the hex to a timestamp beforehand, a (very) hacky way to achieve this would be to configure syslog-ng to follow the files, and run each line through a program.&lt;/P&gt;

&lt;P&gt;i.e. (in syslog-ng.conf)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source ibm_file {
    file("/opt/IBM/log/kbb.log" follow_freq(1)
    flags(no-parse));
};

destination hex_converter { program("/home/user/hex_converter.pl"); };
log { source(ibm_file); destination(hex_converter); };
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the 'hex_converter' program would read from STDIN, convert the hex, and output the converted line to a file that splunk would then index ( or write it out to syslog, or send it as a TCP stream to splunk )&lt;/P&gt;

&lt;P&gt;IBM normally ship a binary called ras1log that'll you could use in the hex_converter before redirecting to another file.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jan 2013 21:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93595#M22687</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-01-21T21:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93596#M22688</link>
      <description>&lt;P&gt;Thanks jonuwz for your answer.&lt;BR /&gt;
Yes I want to use this hex date for the actual event.&lt;BR /&gt;
I'm also consider to make the time conversion on the forwarder side,&lt;BR /&gt;
cause in case of debuging, there will be produced a lot of events on top.Do you see a possiblity to do so?Thanks&lt;BR /&gt;
Robert&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2013 06:00:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93596#M22688</guid>
      <dc:creator>RobertRi</dc:creator>
      <dc:date>2013-01-22T06:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93597#M22689</link>
      <description>&lt;P&gt;How do the logs get to the indexer ? syslog-ng ? universal forwarder ? Whats the application (looks IBM .. ) ?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2013 08:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93597#M22689</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-01-22T08:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93598#M22690</link>
      <description>&lt;P&gt;Yes thats IBM logfiles, which came from a heavy forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jan 2013 14:37:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93598#M22690</guid>
      <dc:creator>RobertRi</dc:creator>
      <dc:date>2013-01-22T14:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: Time Conversion and indexing</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93599#M22691</link>
      <description>&lt;P&gt;Thank you jonuwz for your detailed explainaition.&lt;BR /&gt;
I'm not firm with syslog but I will give it a try and check how this works. &lt;BR /&gt;
I know the ras1log tool, this was my prefered tool to troubleshoot.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jan 2013 06:50:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Time-Conversion-and-indexing/m-p/93599#M22691</guid>
      <dc:creator>RobertRi</dc:creator>
      <dc:date>2013-01-23T06:50:52Z</dc:date>
    </item>
  </channel>
</rss>

