<?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: Can I show the results of two different searches in one visualization? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317304#M20411</link>
    <description>&lt;P&gt;@sundareshr  worked like a charm!!&lt;/P&gt;</description>
    <pubDate>Mon, 20 May 2019 02:07:07 GMT</pubDate>
    <dc:creator>djkj957</dc:creator>
    <dc:date>2019-05-20T02:07:07Z</dc:date>
    <item>
      <title>Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317296#M20403</link>
      <description>&lt;P&gt;I have two separate queries,&lt;/P&gt;

&lt;P&gt;Query1:&lt;BR /&gt;
host="A" OR "B" consumed&lt;BR /&gt;
| eval consume = case (.............)&lt;BR /&gt;
| stats count by consumed&lt;/P&gt;

&lt;P&gt;Query2:&lt;BR /&gt;
host="A" OR "B" produced&lt;BR /&gt;
| eval produce = case (.............)&lt;BR /&gt;
| stats count by produce&lt;/P&gt;

&lt;P&gt;In the visualization tab(column chart) I get two nice chart/graph for each queries.&lt;BR /&gt;
However, I would like a single chart/graph where both the visualization should come side by side.&lt;BR /&gt;
Example : In X axis red bar showing the amount produced and a blue bar adjacent to it showing the amount consumed for each product. &lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 14:29:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317296#M20403</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2017-12-01T14:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317297#M20404</link>
      <description>&lt;P&gt;Splunk can only come close like this:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Viz/VisualizationTrellis"&gt;https://docs.splunk.com/Documentation/SplunkCloud/6.6.3/Viz/VisualizationTrellis&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you need it more stuck/close together then you will have to use a tool like Sideview Utils or roll your JS/html.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 14:47:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317297#M20404</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-12-01T14:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317298#M20405</link>
      <description>&lt;P&gt;@zacksoft, what is the condition for produced and consumed (your eval command)? Ideally you should use eval after stats if possible from performance point of view. Do you mean by side by side or stacked or overlay? Since your base search remains the same you might get the stats together. But you might have to get some sample data and query for us to assist better.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 15:39:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317298#M20405</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-01T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317299#M20406</link>
      <description>&lt;P&gt;The eval command goes like this in Query1,&lt;BR /&gt;
eval consume=case(like(_raw,"%orancon%"),"OrangeConsumed"&lt;BR /&gt;
in Query2,&lt;BR /&gt;
eval produce =case(like(_raw,"%oranpro%"),"OrangeProduced"&lt;/P&gt;

&lt;P&gt;Yes,  I guess overlay or stacked might solve my problem.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:03:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317299#M20406</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2020-09-29T17:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317300#M20407</link>
      <description>&lt;P&gt;@zacksoft, So something like &lt;CODE&gt;orancon&lt;/CODE&gt; in your raw data gives &lt;CODE&gt;oranges consumed&lt;/CODE&gt; and &lt;CODE&gt;oranpro&lt;/CODE&gt; gives you &lt;CODE&gt;orange produced&lt;/CODE&gt;. You can try query like the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; ("orancon" OR "oranpro")
| stats count(eval(searchmatch("orancon"))) as consumed count(eval(searchmatch("oranpro"))) as produced
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or if you want to show the same over time&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;YourBaseSearch&amp;gt; ("orancon" OR "oranpro")
| timechart count(eval(searchmatch("orancon"))) as consumed count(eval(searchmatch("oranpro"))) as produced
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 02 Dec 2017 02:15:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317300#M20407</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2017-12-02T02:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317301#M20408</link>
      <description>&lt;P&gt;@zacksoft, you could do as @niketnilay suggests here or you can create a new field for "pro_con" or "action" (call it whatever) with two values "produced" or "consumed" and then you can chart over state. Like this should work&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    host="A" OR "B" ("orancon" OR "oranpro")
    | eval pro_con=case (match(_raw, "orancon"), "consumed", match(_raw, "oranpro"), "produced", 1=1, "UNK")
    | timechart count by pro_con

    OR
    | stats count by pro_con

    OR 
    | chart count over some_other_grouping_field by pro_con
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;@niketnilay's search is probably more efficient, whereas the above may be more readable. More options to achieve same result.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Dec 2017 15:42:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317301#M20408</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2017-12-02T15:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317302#M20409</link>
      <description>&lt;P&gt;Thank You @sundareshr &lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 06:51:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317302#M20409</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2017-12-04T06:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317303#M20410</link>
      <description>&lt;P&gt;Thanks @niketnilay&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 06:53:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317303#M20410</guid>
      <dc:creator>zacksoft</dc:creator>
      <dc:date>2017-12-04T06:53:16Z</dc:date>
    </item>
    <item>
      <title>Re: Can I show the results of two different searches in one visualization?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317304#M20411</link>
      <description>&lt;P&gt;@sundareshr  worked like a charm!!&lt;/P&gt;</description>
      <pubDate>Mon, 20 May 2019 02:07:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Can-I-show-the-results-of-two-different-searches-in-one/m-p/317304#M20411</guid>
      <dc:creator>djkj957</dc:creator>
      <dc:date>2019-05-20T02:07:07Z</dc:date>
    </item>
  </channel>
</rss>

