<?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: Help required to add sparkline to table/stats in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178651#M44764</link>
    <description>&lt;P&gt;I think the best way would be to untable on the results and then use stats&lt;/P&gt;

&lt;P&gt;E.g. &lt;/P&gt;

&lt;P&gt;Search &lt;BR /&gt;
| streamstats count &lt;BR /&gt;
| eval _time=now()+count*10&lt;BR /&gt;
| untable _time field value&lt;BR /&gt;
| stats sparkling(value), latest(value) by field&lt;/P&gt;</description>
    <pubDate>Thu, 02 Nov 2017 07:34:47 GMT</pubDate>
    <dc:creator>peterchenadded</dc:creator>
    <dc:date>2017-11-02T07:34:47Z</dc:date>
    <item>
      <title>Help required to add sparkline to table/stats</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178649#M44762</link>
      <description>&lt;P&gt;Your help is much appreciated.&lt;/P&gt;

&lt;P&gt;Can get the following table&lt;/P&gt;

&lt;P&gt;sourcetype="test_data" | table monitor1, monitor2, monitor3&lt;/P&gt;

&lt;P&gt;monitor1, monitor2, monitor3&lt;BR /&gt;
0, 1, 1&lt;BR /&gt;
0, 0, 0&lt;BR /&gt;
1, 1, 1&lt;/P&gt;

&lt;P&gt;However would like the following&lt;/P&gt;

&lt;P&gt;column1, column2, column3&lt;BR /&gt;
monitor1, sparkline, 0&lt;BR /&gt;
monitor2, sparkline, 1&lt;BR /&gt;
monitor3, sparkline, 1&lt;/P&gt;

&lt;P&gt;where column1 is the monitor name, column2 is sparkline of the values and column3 is the first top row&lt;/P&gt;</description>
      <pubDate>Fri, 07 Mar 2014 22:33:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178649#M44762</guid>
      <dc:creator>peterchenadded</dc:creator>
      <dc:date>2014-03-07T22:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help required to add sparkline to table/stats</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178650#M44763</link>
      <description>&lt;P&gt;Something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal | stats sparkline(avg(date_second)) as s1 latest(date_second) as l1 sparkline(avg(date_minute)) as s2 latest(date_minute) as l2 sparkline(avg(date_hour)) as s3 latest(date_hour) as l3 | eval column1 = "monitor1 monitor2 monitor3" | makemv column1 | mvexpand column1 | eval column2 = case(column1=="monitor1",s1,column1=="monitor2",s2,column1=="monitor3",s3) | eval column3 = case(column1=="monitor1",l1,column1=="monitor2",l2,column1=="monitor3",l3) | fields column*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It'd be a bit less cumbersome to produce the desired result if you had events like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp monitor="monitor1" value=1
timestamp monitor="monitor2" value=0
timestamp monitor="monitor2" value=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Rather than this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp monitor1=1 monitor2=0 monitor3=1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you could add do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | stats sparkline(avg(value)) latest(value) by monitor
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Much more concise and flexible that way, depends on what your data actually looks like.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Mar 2014 00:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178650#M44763</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-03-08T00:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help required to add sparkline to table/stats</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178651#M44764</link>
      <description>&lt;P&gt;I think the best way would be to untable on the results and then use stats&lt;/P&gt;

&lt;P&gt;E.g. &lt;/P&gt;

&lt;P&gt;Search &lt;BR /&gt;
| streamstats count &lt;BR /&gt;
| eval _time=now()+count*10&lt;BR /&gt;
| untable _time field value&lt;BR /&gt;
| stats sparkling(value), latest(value) by field&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2017 07:34:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-required-to-add-sparkline-to-table-stats/m-p/178651#M44764</guid>
      <dc:creator>peterchenadded</dc:creator>
      <dc:date>2017-11-02T07:34:47Z</dc:date>
    </item>
  </channel>
</rss>

