<?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: How do I set _time with collect _raw? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409724#M72643</link>
    <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/44249"&gt;@yurykiselev&lt;/a&gt;,&lt;BR /&gt;
If time is already in the _raw in a format that Splunk can understand easily then you will add  &lt;CODE&gt;addtime=false&lt;/CODE&gt; as a option with collect command and Splunk will automatically extracts time from _raw no need to extract separately.&lt;/P&gt;

&lt;P&gt;If not the above scenario then you have to write props.conf for the source-type you are using.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;If time format is weird then you must have specify time format into TIME_FORMAT. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/SearchReference/Commontimeformatvariables" target="_blank"&gt;This&lt;/A&gt; may help you in writing that format)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If time format is not available within first 128 characters of _raw event then you have to add MAX_TIMESTAMP_LOOKAHEAD.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;You can also specify TIME_PREFIX. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.0/Admin/Propsconf" target="_blank"&gt;props.conf&lt;/A&gt; may help you in all the configuration writing)&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this helps!!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:33:57 GMT</pubDate>
    <dc:creator>VatsalJagani</dc:creator>
    <dc:date>2020-09-29T21:33:57Z</dc:date>
    <item>
      <title>How do I set _time with collect _raw?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409723#M72642</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
I have to collect some JSON "as is" - not as key-value pair. How can I set event timestamp in this case?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval _time=strptime(...) | table _time _raw | collect index="..."
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... doesn't work: _time is ignored with _raw present and replaced with cirrent time. I could do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval data = _raw | table _time data | collect ... 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;, but it generates key-value-event with "data={my_json_from_raw}"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409723#M72642</guid>
      <dc:creator>yurykiselev</dc:creator>
      <dc:date>2020-09-29T21:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set _time with collect _raw?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409724#M72643</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/44249"&gt;@yurykiselev&lt;/a&gt;,&lt;BR /&gt;
If time is already in the _raw in a format that Splunk can understand easily then you will add  &lt;CODE&gt;addtime=false&lt;/CODE&gt; as a option with collect command and Splunk will automatically extracts time from _raw no need to extract separately.&lt;/P&gt;

&lt;P&gt;If not the above scenario then you have to write props.conf for the source-type you are using.&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;If time format is weird then you must have specify time format into TIME_FORMAT. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.3/SearchReference/Commontimeformatvariables" target="_blank"&gt;This&lt;/A&gt; may help you in writing that format)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;If time format is not available within first 128 characters of _raw event then you have to add MAX_TIMESTAMP_LOOKAHEAD.&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;You can also specify TIME_PREFIX. (&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.0/Admin/Propsconf" target="_blank"&gt;props.conf&lt;/A&gt; may help you in all the configuration writing)&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;Hope this helps!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409724#M72643</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2020-09-29T21:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set _time with collect _raw?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409725#M72644</link>
      <description>&lt;P&gt;Thank you! I added date at begin of data "%Y-%m-%d %H:%M:%S" - it's recignized without any props defineding.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 13:24:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409725#M72644</guid>
      <dc:creator>yurykiselev</dc:creator>
      <dc:date>2018-10-08T13:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: How do I set _time with collect _raw?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409726#M72645</link>
      <description>&lt;P&gt;Nice!!, This time format is identify by Splunk so good for you.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Oct 2018 14:13:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-set-time-with-collect-raw/m-p/409726#M72645</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2018-10-08T14:13:22Z</dc:date>
    </item>
  </channel>
</rss>

