<?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: Convert DateTime format befor indexing and write in _time. Time of event have hex format. in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331618#M61433</link>
    <description>&lt;P&gt;I tried like this: &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html" target="_blank"&gt;https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and like this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/30852/hex-time-stamp-extraction-issues-with-datetime-config.html" target="_blank"&gt;https://answers.splunk.com/answers/30852/hex-time-stamp-extraction-issues-with-datetime-config.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But it did not work out.&lt;/P&gt;

&lt;P&gt;Below my configurations:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test_write_hextime_to_timestamp]
DATETIME_CONFIG = /etc/my_hex_epoch_datetime.xml
MAX_TIMESTAMP_LOOKAHEAD = 8
TIME_PREFIX = time="
BREAK_ONLY_BEFORE = &amp;lt;telegram
MUST_BREAK_AFTER = &amp;lt;/telegram&amp;gt;
REPORT-test-hex-convert = REPORT-test-hex-convert
EVAL-date_time_test = strftime(tonumber(time, 16), "%m:%d:%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my_hex_epoch_datetime.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="_hexepoch" extract="hexepoch"&amp;gt;
    &amp;lt;text&amp;gt;&amp;lt;![CDATA[time="0x([\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;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 29 Sep 2020 13:43:24 GMT</pubDate>
    <dc:creator>chernigin_yuri</dc:creator>
    <dc:date>2020-09-29T13:43:24Z</dc:date>
    <item>
      <title>Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331614#M61429</link>
      <description>&lt;P&gt;Hello everybody!&lt;BR /&gt;
I have trouble with parsing time of event in time indexing.Fields of time in my raw event  have hex system - this unix time. How i can to convert from hex to decimal and convert from unix to human readble date time. But i wanna do this before indexing, fore example in props.conf and transforms.conf, i need write down this time in _time &lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 09:58:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331614#M61429</guid>
      <dc:creator>chernigin_yuri</dc:creator>
      <dc:date>2017-04-17T09:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331615#M61430</link>
      <description>&lt;P&gt;Please share some sample data.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 12:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331615#M61430</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-04-17T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331616#M61431</link>
      <description>&lt;P&gt;For example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;telegram time_formatted="undefined date" time="0x56A7DEC7" type="16" datalen="2001"&amp;gt; // this is the title of each event.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 17 Apr 2017 21:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331616#M61431</guid>
      <dc:creator>chernigin_yuri</dc:creator>
      <dc:date>2017-04-17T21:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331617#M61432</link>
      <description>&lt;P&gt;I  tried to convert the time value(0x56A7DEC7) using below link and got the date as "GMT: Tue, 26 Jan 2016 21:01:59".&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.epochconverter.com/hex"&gt;https://www.epochconverter.com/hex&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If the conversion is accurate , you can follow the xml option mentioned in below post.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html"&gt;https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 10:09:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331617#M61432</guid>
      <dc:creator>Ravan</dc:creator>
      <dc:date>2017-04-18T10:09:20Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331618#M61433</link>
      <description>&lt;P&gt;I tried like this: &lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html" target="_blank"&gt;https://answers.splunk.com/answers/4880/hex-encoded-unix-timestamp.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;and like this:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/30852/hex-time-stamp-extraction-issues-with-datetime-config.html" target="_blank"&gt;https://answers.splunk.com/answers/30852/hex-time-stamp-extraction-issues-with-datetime-config.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;But it did not work out.&lt;/P&gt;

&lt;P&gt;Below my configurations:&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[test_write_hextime_to_timestamp]
DATETIME_CONFIG = /etc/my_hex_epoch_datetime.xml
MAX_TIMESTAMP_LOOKAHEAD = 8
TIME_PREFIX = time="
BREAK_ONLY_BEFORE = &amp;lt;telegram
MUST_BREAK_AFTER = &amp;lt;/telegram&amp;gt;
REPORT-test-hex-convert = REPORT-test-hex-convert
EVAL-date_time_test = strftime(tonumber(time, 16), "%m:%d:%Y %H:%M:%S")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;my_hex_epoch_datetime.xml&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;define name="_hexepoch" extract="hexepoch"&amp;gt;
    &amp;lt;text&amp;gt;&amp;lt;![CDATA[time="0x([\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;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:43:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331618#M61433</guid>
      <dc:creator>chernigin_yuri</dc:creator>
      <dc:date>2020-09-29T13:43:24Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331619#M61434</link>
      <description>&lt;P&gt;I tried with a sample data and it does work. Can double check stanzas and file permissions..? &lt;/P&gt;

&lt;P&gt;Here are the configs i have. (Avoid the spaces in the config file line beginnings)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt; &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[your sourcetype]
TIME_PREFIX = time="
MAX_TIMESTAMP_LOOKAHEAD = 16
BREAK_ONLY_BEFORE = &amp;lt;telegram
MUST_BREAK_AFTER = &amp;lt;/telegram&amp;gt;
DATETIME_CONFIG = /etc/my_hex_epoch_datetime.xml
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;$SPLUNK_HOME/etc/my_hex_epoch_datetime.xml&lt;/STRONG&gt;&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[0x([A-Fa-f0-9]{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;</description>
      <pubDate>Tue, 29 Sep 2020 13:43:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331619#M61434</guid>
      <dc:creator>Ravan</dc:creator>
      <dc:date>2020-09-29T13:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Convert DateTime format befor indexing and write in _time. Time of event have hex format.</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331620#M61435</link>
      <description>&lt;P&gt;Many thanks!!! Success! &lt;BR /&gt;
Your configuration is rigth.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 13:10:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Convert-DateTime-format-befor-indexing-and-write-in-time-Time-of/m-p/331620#M61435</guid>
      <dc:creator>chernigin_yuri</dc:creator>
      <dc:date>2017-04-20T13:10:47Z</dc:date>
    </item>
  </channel>
</rss>

