<?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: datamodel not able to plot timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155591#M43777</link>
    <description>&lt;P&gt;I see.  What are you using the second splitrow for?  I ask because in the original post the "host" field was not being used by "timechart" so the second splitrow could simply have been removed.&lt;/P&gt;

&lt;P&gt;If you can't drop the second splitrow, then it's going to get a little ugly.  The bug is that the pivot command is formatting the epoch times into human readable timestamps, so you'll have to reverse that transformation:&lt;/P&gt;

&lt;P&gt;| convert timeformat="%Y-%m-%dT%H:%M:%S.%3Q-%z" mktime(_time) as _time | timechart ...&lt;/P&gt;

&lt;P&gt;I wish I had a more elegant solution for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 06 Apr 2015 23:22:28 GMT</pubDate>
    <dc:creator>Simon_Fishel</dc:creator>
    <dc:date>2015-04-06T23:22:28Z</dc:date>
    <item>
      <title>datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155587#M43773</link>
      <description>&lt;P&gt;I have simple datamodel, which I am using as query and want to plot time chart series. Now I am not able to plot anything using timechart, but can plot from chart &amp;lt;&amp;gt; by _time. I don't know what I am missing, due to this I am not able to that in dashboard.&lt;/P&gt;

&lt;P&gt;| pivot DataModel_AccessService perf count(TPS) AS "tps" sum(execTime) AS "execTime"  SPLITROW _time AS _time PERIOD AUTO SPLITROW host AS hostname&lt;/P&gt;

&lt;P&gt;This query is working &lt;BR /&gt;
| pivot DataModel_AccessService perf count(TPS) AS "tps" sum(execTime) AS "execTime"  SPLITROW _time AS _time PERIOD AUTO SPLITROW host AS hostname| chart sum(execTime) by _time&lt;/P&gt;

&lt;P&gt;This query is not working&lt;BR /&gt;
| pivot DataModel_AccessService perf count(TPS) AS "tps" sum(execTime) AS "execTime"  SPLITROW _time AS _time PERIOD AUTO SPLITROW host AS hostname| timechart sum(execTime)&lt;/P&gt;

&lt;P&gt;Please help me out. &lt;/P&gt;</description>
      <pubDate>Wed, 10 Dec 2014 01:53:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155587#M43773</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2014-12-10T01:53:20Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155588#M43774</link>
      <description>&lt;P&gt;I have the same issue. It is probably a bug &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 21:49:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155588#M43774</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-04-06T21:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155589#M43775</link>
      <description>&lt;P&gt;It does seem to be a bug, it looks like if you use SPLITROW more than once you lose the ability to run timechart afterwards.&lt;/P&gt;

&lt;P&gt;High level, what are you trying to accomplish with this query?  I might be able to suggest another way.  For example, if all you're after is a the sum of execTime over time then this should do it:&lt;/P&gt;

&lt;P&gt;| pivot DataModel_AccessService perf sum(execTime) AS "execTime" SPLITROW _time AS _time PERIOD AUTO&lt;/P&gt;

&lt;P&gt;The pivot command will actually use timechart under the hood when it can.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 22:56:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155589#M43775</guid>
      <dc:creator>Simon_Fishel</dc:creator>
      <dc:date>2015-04-06T22:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155590#M43776</link>
      <description>&lt;P&gt;I want to use timechart's ability to accept a dynamic span depending on time range searched by way of a macro. That is not possible with pivot.&lt;BR /&gt;
My solution is to do a pivot with the minimum period of "minute" followed by a timechart with dynamic span. As you wrote, that fails as soon as a second splitrow is used.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155590#M43776</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-04-06T23:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155591#M43777</link>
      <description>&lt;P&gt;I see.  What are you using the second splitrow for?  I ask because in the original post the "host" field was not being used by "timechart" so the second splitrow could simply have been removed.&lt;/P&gt;

&lt;P&gt;If you can't drop the second splitrow, then it's going to get a little ugly.  The bug is that the pivot command is formatting the epoch times into human readable timestamps, so you'll have to reverse that transformation:&lt;/P&gt;

&lt;P&gt;| convert timeformat="%Y-%m-%dT%H:%M:%S.%3Q-%z" mktime(_time) as _time | timechart ...&lt;/P&gt;

&lt;P&gt;I wish I had a more elegant solution for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:22:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155591#M43777</guid>
      <dc:creator>Simon_Fishel</dc:creator>
      <dc:date>2015-04-06T23:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155592#M43778</link>
      <description>&lt;P&gt;this is way how I have handle it &lt;BR /&gt;
| tstats sum(DAC.time_ms) as agent_time_ms FROM datamodel=DataModel_DAC groupby _time|timechart span=10m avg(agent_time_ms) as agent_time_ms&lt;/P&gt;

&lt;P&gt;let me know if you have questions, though this command will work only when data model is accelerated.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:28:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155592#M43778</guid>
      <dc:creator>sumitnagal</dc:creator>
      <dc:date>2020-09-28T19:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155593#M43779</link>
      <description>&lt;P&gt;I am avoiding tstats because it does not support realtime searches.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:28:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155593#M43779</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-04-06T23:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155594#M43780</link>
      <description>&lt;P&gt;To be brief... you are kind of mixing metaphors. The Pivot interface (and underlying language) is meant to be used to create a chart without using the SPL (Search Processing Language).  &lt;CODE&gt;timechart&lt;/CODE&gt; is an SPL command that has an automatic x-axis of _time and the PERIOD is governed by the span directive. You can't reproduce that exactly in PIVOT. &lt;/P&gt;

&lt;P&gt;If you really want a traditional timechart built against your datamodel, you want the &lt;CODE&gt;|datamodel&lt;/CODE&gt; command. That enables you to access a datamodel, but use the SPL.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Datamodel"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.2/SearchReference/Datamodel&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:30:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155594#M43780</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-06T23:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155595#M43781</link>
      <description>&lt;P&gt;If I am not mistaken the &lt;CODE&gt;datamodel&lt;/CODE&gt; command is not accelerated even if the underlying data model is. That makes it irrelevant.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155595#M43781</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-04-06T23:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155596#M43782</link>
      <description>&lt;P&gt;Helge, it might be irrelevant to you as you have the need to use an accelerated datamodel, but not to the original questioner. Point being, PIVOT is not the correct method.  You might want to open a new question specific to your needs.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:38:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155596#M43782</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2015-04-06T23:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155597#M43783</link>
      <description>&lt;P&gt;Thanks, Simon, but that does not seem to work. The timechart command still does not generate output. I also tried variations with "eval strftime/strptime" without success.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155597#M43783</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2015-04-06T23:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155598#M43784</link>
      <description>&lt;P&gt;Weird, it worked for me locally.  The problem with eval strftime/strptime is that they're designed to convert an epoch time into a human-readable string, you need to do the opposite.  What version of Splunk are you running?  &lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2015 23:53:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155598#M43784</guid>
      <dc:creator>Simon_Fishel</dc:creator>
      <dc:date>2015-04-06T23:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: datamodel not able to plot timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155599#M43785</link>
      <description>&lt;P&gt;I use the following eval after the pivot to convert the human readable times back to raw time values on 6.2.5 Splunk Enterprise and it works fine.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot DataModel_AccessService perf count(TPS) AS "tps" sum(execTime) AS "execTime" SPLITROW _time AS _time PERIOD AUTO SPLITROW host AS hostname | eval _time = strptime(_time, "%Y-%m-%dT%H:%M:%S.%3N%z") | timechart sum(execTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like Splunk Enterprise 6.3.1 fixes this issue. The time values are not automatically converted to human readable form on my 6.3.1 instance.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Nov 2015 15:01:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/datamodel-not-able-to-plot-timechart/m-p/155599#M43785</guid>
      <dc:creator>rjthibod</dc:creator>
      <dc:date>2015-11-23T15:01:12Z</dc:date>
    </item>
  </channel>
</rss>

