<?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: hex encoded unix timestamp? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17821#M2374</link>
    <description>&lt;P&gt;I'm using literally a copy and paste of above and Splunk isn't picking up the hex timestamp.  Anyone run into this?&lt;/P&gt;</description>
    <pubDate>Wed, 23 Apr 2014 23:08:59 GMT</pubDate>
    <dc:creator>beaunewcomb</dc:creator>
    <dc:date>2014-04-23T23:08:59Z</dc:date>
    <item>
      <title>hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17815#M2368</link>
      <description>&lt;P&gt;Can Splunk be configured to index my events (below) that have a hex encoded unix timestamp?&lt;/P&gt;

&lt;P&gt;4c36117c maverick aaaaa anykey TRUE /Applications/splunk/etc/apps/search/local/blah.txt zzzzz&lt;BR /&gt;
4c361184 maverick bbbbb allkey TRUE /Applications/splunk/etc/apps/search/local/blam.txt yyyyy&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2010 09:43:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17815#M2368</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2010-07-21T09:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17816#M2369</link>
      <description>&lt;P&gt;Yes it can. It would probably be a good idea to use a TIME_PREFIX and TIME_FORMAT for it though (&lt;CODE&gt;%s&lt;/CODE&gt;). And a MAX_TIMESTAMP_LOOKAHEAD.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2010 10:02:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17816#M2369</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-07-21T10:02:02Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17817#M2370</link>
      <description>&lt;P&gt;because its hexadecimal now and needs to be converted to unix timestamp, which looks like it's just the seconds only, will TIME_FORMAT settings actually work?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2010 10:17:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17817#M2370</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2010-07-21T10:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17818#M2371</link>
      <description>&lt;P&gt;Not sure if I have it correct, so please tell me, but I did manage to run the following search to test  out what you were saying and it still does not seem to work:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;| eval convertedhex = 1278611836 | rex "^(?\S+?)\smaverick" | eval astrptime = strptime(atime, "%s") | convert ctime(convertedhex) ctime(astrptime)&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;The results are:&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;convertedhex=07/08/2010 12:57:16&lt;/P&gt;

&lt;P&gt;astrptime=12/31/1969 18:00:04.000000&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Only when I convert the hexadecimal to decimal first like the above, it appears correct.&lt;/P&gt;

&lt;P&gt;I also tried using %+ and %S for the strptime part, but I receive the same results above.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jul 2010 21:55:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17818#M2371</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2010-07-21T21:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17819#M2372</link>
      <description>&lt;P&gt;If you want to have it do time extraction at index-time it IS possible, but only if you're willing to set up custom a custom datetime.xml file.  The easier-to-use TIME_FORMAT setting doesn't have any way to specify hexadecimal numbers, so you have to get down and dirty with some XML to make it happen.  Also, you'll need to be running Splunk 4.1.4 — earlier versions had more limited support for hex epoch values.&lt;/P&gt;

&lt;P&gt;You'll need a datetime.xml file that make a regex to match the timestamp and extract it as "hexepoch".  Lets call it $SPLUNK_HOME/etc/my-hex-epoch.xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;       &amp;lt;datetime&amp;gt;
         &amp;lt;define name="_hexepoch" extract="hexepoch"&amp;gt;
           &amp;lt;text&amp;gt;&amp;lt;![CDATA[([\da-fA-F]{8})]]&amp;gt;&amp;lt;/text&amp;gt;
         &amp;lt;/define&amp;gt;
         &amp;lt;timePatterns&amp;gt;
           &amp;lt;use name="_hexepoch"/&amp;gt;
         &amp;lt;/timePatterns&amp;gt;
         &amp;lt;datePatterns&amp;gt;
         &amp;lt;/datePatterns&amp;gt;
       &amp;lt;/datetime&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then in props.conf you'd configure the sourcetype as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  DATETIME_CONFIG = /etc/my-hex-epoch.xml
  MAX_TIMESTAMP_LOOKAHEAD = 8
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Jul 2010 14:44:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17819#M2372</guid>
      <dc:creator>mitch</dc:creator>
      <dc:date>2010-07-22T14:44:42Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17820#M2373</link>
      <description>&lt;P&gt;Perfect! Thanks, Mitch.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2010 20:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17820#M2373</guid>
      <dc:creator>maverick</dc:creator>
      <dc:date>2010-07-22T20:19:11Z</dc:date>
    </item>
    <item>
      <title>Re: hex encoded unix timestamp?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17821#M2374</link>
      <description>&lt;P&gt;I'm using literally a copy and paste of above and Splunk isn't picking up the hex timestamp.  Anyone run into this?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Apr 2014 23:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/hex-encoded-unix-timestamp/m-p/17821#M2374</guid>
      <dc:creator>beaunewcomb</dc:creator>
      <dc:date>2014-04-23T23:08:59Z</dc:date>
    </item>
  </channel>
</rss>

