<?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 can I create a Splunk conditional multiline chart? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645503#M52691</link>
    <description>&lt;P&gt;Hi there, thanks for your answer, the link returns 404 error for me, do you have a working one I can use? thanks&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jun 2023 08:08:50 GMT</pubDate>
    <dc:creator>SkyeCoder</dc:creator>
    <dc:date>2023-06-02T08:08:50Z</dc:date>
    <item>
      <title>How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645432#M52682</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;I have spent 3 days looking for an answer with no luck, I'm hoping that someone here can help.&lt;/P&gt;
&lt;P&gt;I want to create one panel with one chart. I want the chart to have multiple lines that are created by different queries. I want to have a checkbox for each query/line, so that when you check the box, its corresponding query gets run and the resulting line appears.&lt;/P&gt;
&lt;P&gt;Git example let's say I have the following queries:&lt;/P&gt;
&lt;P&gt;1) Search message = "abcd" | timechart count AS abcd&lt;/P&gt;
&lt;P&gt;2) Search message = "efgh" | timechart count AS efgh&lt;/P&gt;
&lt;P&gt;3) Search message = "ijkl" | timechart count AS ijkl&lt;/P&gt;
&lt;P&gt;And so on...&lt;/P&gt;
&lt;P&gt;I want these checkboxes: A, E, I....&amp;nbsp; let's say&lt;/P&gt;
&lt;P&gt;When none of the boxes are check I don't want to see any lines on the chart. When I click A I want to see the data for abcd search appear on the chart. When I click on E, I want to see the efgh line appear on top of the abcd line. When I click I, I want to see the ijkl line appear on top of the other two. If I uncheck E, I want to see efgh line disappear but other two remain... You get the idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to add as many queries as I want, and have a checkbox for each query, and show the result line of that query on top of other lines when I click on its checkbox.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this possible? I'd appreciate any help for this.&lt;/P&gt;
&lt;P&gt;Many thanks,&lt;/P&gt;
&lt;P&gt;Skye&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 06:20:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645432#M52682</guid>
      <dc:creator>SkyeCoder</dc:creator>
      <dc:date>2023-06-02T06:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645494#M52687</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257342"&gt;@SkyeCoder&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if I correctly understood you requirement, it's possible.&lt;/P&gt;&lt;P&gt;See in the&amp;nbsp;&lt;SPAN&gt;Splunk Dashboard Examples App (&lt;/SPAN&gt;&lt;A href="https://splunkbase.splunk.com/app/1603)" target="_blank" rel="nofollow noopener noreferrer"&gt;https://splunkbase.splunk.com/app/1603)&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;Link switches dashboard.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Ciao.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Giuseppe&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 07:40:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645494#M52687</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-02T07:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645500#M52689</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I think that you can do most of it, but getting the last clicked chart on top of pile, I don't know maybe with JS/CSS, but I'm not expert with those.&lt;/P&gt;&lt;P&gt;I suppose that you are knowing how to do dasboards and use tokens, so I don't explains those in detail/example levels.&lt;/P&gt;&lt;P&gt;You should try something like base search which collect all those events instead of use several separate almost equal searches. I use _audit as example&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_audit action=*
| timechart span=5m count(eval(action=="search")) as abc count(eval(action=="list_health")) as def count(eval(action=="list_workload_pools")) as ghi count(eval(action=="never happened")) as jkl&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With that query you will get all needed data with one real query. Then create separate queries for every checkbox like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;```use base search ``
| fields _time &amp;lt;abc field name etc.&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then use tokens for visibility (depends) for those panels which you have clicked.&lt;/P&gt;&lt;P&gt;I suppose that with this base idea you should have everything else than this "random" order.&lt;/P&gt;&lt;P&gt;r. Ismo&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 08:01:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645500#M52689</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-02T08:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645502#M52690</link>
      <description>&lt;P&gt;Thank you for your reply, it is very informative. However, one of the motivation for running separate queries is to speed up the search by switching the unwanted ones off. if I have one search that collects all the data I would be waiting a log time. However, your solution could work if we accept that it will be a slow response. Can you elaborate on your answer, you mentioned "depends" but that is for panels, I want to have one panel with multiple lines on one chart. Do you think that is possible? thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 08:08:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645502#M52690</guid>
      <dc:creator>SkyeCoder</dc:creator>
      <dc:date>2023-06-02T08:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645503#M52691</link>
      <description>&lt;P&gt;Hi there, thanks for your answer, the link returns 404 error for me, do you have a working one I can use? thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 08:08:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645503#M52691</guid>
      <dc:creator>SkyeCoder</dc:creator>
      <dc:date>2023-06-02T08:08:50Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645507#M52692</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/257342"&gt;@SkyeCoder&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;sorry! there was a copy and past error, please try this:&amp;nbsp;&lt;A href="https://splunkbase.splunk.com/app/1603" target="_blank"&gt;https://splunkbase.splunk.com/app/1603&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 08:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645507#M52692</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-06-02T08:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a Splunk conditional multiline chart?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645551#M52701</link>
      <description>&lt;P&gt;Is one base search with chain searches or several searches more efficient is something what you must check with your environment. &amp;nbsp;With several searches you probably need to read much more events from disk than with one base + chain, but of course it depends on your real searches.&lt;/P&gt;&lt;P&gt;If/when you want to put all in one panel/chart it's doable and actually the norma way to do it.&lt;/P&gt;&lt;P&gt;With SimpleXML You should just use tokens to select what values you want to see. Something like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1"&amp;gt;
  &amp;lt;label&amp;gt;EXAMPLE&amp;lt;/label&amp;gt;
  &amp;lt;description&amp;gt;DESC&amp;lt;/description&amp;gt;
  &amp;lt;fieldset submitButton="false" autoRun="true"&amp;gt;
    &amp;lt;input type="multiselect" token="tp_tok" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;FooBar&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;foobar IN (&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;delimiter&amp;gt;,&amp;lt;/delimiter&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;| tstats count where host="xxx" index="xyz" sourcetype="abc" by foobar&amp;lt;/query&amp;gt;
        &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
        &amp;lt;latest&amp;gt;&amp;lt;/latest&amp;gt;
      &amp;lt;/search&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;foobar&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;foobar&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
      &amp;lt;valuePrefix&amp;gt;"&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;TITLE for Graph&amp;lt;/title&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;host="xx" index="xyz" sourcetype="abc" $tp_tok$
| timechart sum(as_lkm) as as_lkm by foobar&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
.... some options removed ....
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
....
&amp;lt;/form&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Here is heavily modified/removed lines etc. from one dashboard which I have. Probably didn't work as it, but I hope that you would get the idea from here.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Basically that get those "foobar" values from index and then you could select which one you are showing on dashboard. Default is that you are seeing all.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jun 2023 12:48:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-can-I-create-a-Splunk-conditional-multiline-chart/m-p/645551#M52701</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2023-06-02T12:48:43Z</dc:date>
    </item>
  </channel>
</rss>

