<?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: Timechart on field other than _time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315757#M94513</link>
    <description>&lt;P&gt;Nevermind, I got it to work.  I must have forgotten strptime:&lt;/P&gt;

&lt;P&gt;| dbxquery query="SQL query here" | dedup id_number |rename "SQL Submit Date" as SubmitDate| eval ttime=SubmitDate | makemv delim="," ttime | mvexpand ttime | eval _time=strptime(ttime, "%Y-%m-%d %H:%M:%S.%N") | timechart span=1d sum("Projected_Cost") as Potential_Cost by Incident&lt;/P&gt;

&lt;P&gt;THANK YOU!!!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:58:52 GMT</pubDate>
    <dc:creator>Svill321</dc:creator>
    <dc:date>2020-09-29T14:58:52Z</dc:date>
    <item>
      <title>Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315750#M94506</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm working on a time chart that needs to chart based on the time retrieved from the database.  So far, the chart is only working with _time.  Here is my query so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery SQL query | dedup id_number| eval _time=strptime("date time","%Y-%m-%d %H:%M:%S.%N") | eval _time="date time" | timechart span=1d sum("Projected_Cost") as Potential_Cost by Incedent
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So far, though, all I've gotten is a blank chart.  Here is an example time stamp:&lt;/P&gt;

&lt;P&gt;2017-03-14 17:19:25.0&lt;/P&gt;

&lt;P&gt;If anyone can give me any help whatsoever, that would be great.  I've been hitting a wall with this for several hours.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 18:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315750#M94506</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-18T18:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315751#M94507</link>
      <description>&lt;P&gt;why do you have the &lt;CODE&gt;... | eval _time="data time"&lt;/CODE&gt; ?&lt;BR /&gt;
try and remove it and run:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery SQL query 
| dedup id_number
| eval _time=strptime("date time","%Y-%m-%d %H:%M:%S.%N") 
| timechart span=1d sum("Projected_Cost") as Potential_Cost by Incedent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Jul 2017 18:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315751#M94507</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-07-18T18:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315752#M94508</link>
      <description>&lt;P&gt;I'm basing that part off of this answer here:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/145562/how-to-use-a-field-as-timestamp-for-a-timechart.html"&gt;https://answers.splunk.com/answers/145562/how-to-use-a-field-as-timestamp-for-a-timechart.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Removing it causes the search to fail.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 18:19:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315752#M94508</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-18T18:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315753#M94509</link>
      <description>&lt;P&gt;tried it again and it works nicely&lt;BR /&gt;
try this search:&lt;BR /&gt;
| makeresults &lt;BR /&gt;
| eval ttime = "2017-03-14 17:19:25.0, 2017-03-14 17:19:25.0, 2017-03-15 17:19:25.0, 2017-03-15 17:19:25.0, 2017-03-16 17:19:25.0, 2017-03-17 17:19:25.0"&lt;BR /&gt;
| makemv delim="," ttime&lt;BR /&gt;
| mvexpand ttime&lt;BR /&gt;
| eval _time = strptime(ttime, "%Y-%m-%d %H:%M:%S.%N")&lt;BR /&gt;
| timechart count&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 18:33:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315753#M94509</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-07-18T18:33:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315754#M94510</link>
      <description>&lt;P&gt;@adonio  -  It shouldn't work.  I've forgotten which of N or Q defaults to 3 vs 6 digits, but you should need to tell %N that there's only 1 digit.  try  %1N&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Commontimeformatvariables"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/Commontimeformatvariables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Jul 2017 20:47:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315754#M94510</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-18T20:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315755#M94511</link>
      <description>&lt;P&gt;@DalJeanis, thank you for your comment&lt;BR /&gt;
placing in an answer so i can show screenshot&lt;BR /&gt;
tried with .%1N and .%N and added some miliseconds 2, 5, and 9 to verify.&lt;BR /&gt;
the results are the same and looks like the default is %3N regardless:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3223i739189F60A848B4D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3224iCC7A86E130836286/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;as for the question, &lt;BR /&gt;
i hope it answers it already. if not, please let us know how we can further assist&lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 00:17:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315755#M94511</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-07-19T00:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315756#M94512</link>
      <description>&lt;P&gt;Every time I try to test, it returns the error:&lt;/P&gt;

&lt;P&gt;Error in 'eval' command: The expression is malformed. Expected ).&lt;/P&gt;

&lt;P&gt;Which doesn't make any sense, since the last character is the closing parenthesis.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbxquery query="SQL query here"| dedup id_number | rename "SQL Submit Date" as SubmitDate| eval ttime=SubmitDate | makemv delim="," ttime | mvexpand ttime | eval _time=(ttime, "%Y-%m-%d %H:%M:%S.%N")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Before that, it seems to work fine, so my best guess is that its an issue with the time format.  &lt;/P&gt;</description>
      <pubDate>Wed, 19 Jul 2017 14:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315756#M94512</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2017-07-19T14:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart on field other than _time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315757#M94513</link>
      <description>&lt;P&gt;Nevermind, I got it to work.  I must have forgotten strptime:&lt;/P&gt;

&lt;P&gt;| dbxquery query="SQL query here" | dedup id_number |rename "SQL Submit Date" as SubmitDate| eval ttime=SubmitDate | makemv delim="," ttime | mvexpand ttime | eval _time=strptime(ttime, "%Y-%m-%d %H:%M:%S.%N") | timechart span=1d sum("Projected_Cost") as Potential_Cost by Incident&lt;/P&gt;

&lt;P&gt;THANK YOU!!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-on-field-other-than-time/m-p/315757#M94513</guid>
      <dc:creator>Svill321</dc:creator>
      <dc:date>2020-09-29T14:58:52Z</dc:date>
    </item>
  </channel>
</rss>

