<?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 set up a new field for timestamp - not working in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451740#M78311</link>
    <description>&lt;P&gt;I am running a search against JSON data, and I am able to get the field I am interested in. Now, I am trying to set that field as a timestamp for charts, but it is not working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=idx-index-name "fields.created"="*"
| eval _time=strptime("fields.created","%Y-%m-%dT%H:%M:%SZ")
| timechart span=1d count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Value of field - "fields.created" - &lt;CODE&gt;2019-01-09T10:51:34.000-0500&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I remove the second line and run the command, all the events are in index time ( today ), but the records are from the last 1 month.&lt;/P&gt;

&lt;P&gt;Can someone help me find what i am missing?&lt;/P&gt;</description>
    <pubDate>Sun, 03 Feb 2019 19:36:49 GMT</pubDate>
    <dc:creator>premraj_vs</dc:creator>
    <dc:date>2019-02-03T19:36:49Z</dc:date>
    <item>
      <title>set up a new field for timestamp - not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451740#M78311</link>
      <description>&lt;P&gt;I am running a search against JSON data, and I am able to get the field I am interested in. Now, I am trying to set that field as a timestamp for charts, but it is not working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=idx-index-name "fields.created"="*"
| eval _time=strptime("fields.created","%Y-%m-%dT%H:%M:%SZ")
| timechart span=1d count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Value of field - "fields.created" - &lt;CODE&gt;2019-01-09T10:51:34.000-0500&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If I remove the second line and run the command, all the events are in index time ( today ), but the records are from the last 1 month.&lt;/P&gt;

&lt;P&gt;Can someone help me find what i am missing?&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 19:36:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451740#M78311</guid>
      <dc:creator>premraj_vs</dc:creator>
      <dc:date>2019-02-03T19:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: set up a new field for timestamp - not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451741#M78312</link>
      <description>&lt;P&gt;Hi @premraj_vs &lt;/P&gt;

&lt;P&gt;Give this a try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; index=idx-index-name "fields.created"="*"
 | eval _time=strptime('fields.created',"%Y-%m-%dT%H:%M:%SZ")
 | timechart span=1d count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sometimes you need to use single quotes when referring to field names that have strange characters in them.&lt;/P&gt;

&lt;P&gt;All the best&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 19:46:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451741#M78312</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-03T19:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: set up a new field for timestamp - not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451742#M78313</link>
      <description>&lt;P&gt;It worked .. Thanks for the help&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 22:55:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451742#M78313</guid>
      <dc:creator>premraj_vs</dc:creator>
      <dc:date>2019-02-03T22:55:58Z</dc:date>
    </item>
    <item>
      <title>Re: set up a new field for timestamp - not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451743#M78314</link>
      <description>&lt;P&gt;OK Looks like your strptime format is wrong. Try this one instead: &lt;CODE&gt;%Y-%m-%dT%H:%M:%S.%3Q%z&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 23:12:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451743#M78314</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-02-03T23:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: set up a new field for timestamp - not working</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451744#M78315</link>
      <description>&lt;P&gt;yes i made this change&lt;/P&gt;</description>
      <pubDate>Sun, 03 Feb 2019 23:26:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/set-up-a-new-field-for-timestamp-not-working/m-p/451744#M78315</guid>
      <dc:creator>premraj_vs</dc:creator>
      <dc:date>2019-02-03T23:26:25Z</dc:date>
    </item>
  </channel>
</rss>

