<?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 do you chart two unrelated numbers? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386667#M112845</link>
    <description>&lt;P&gt;This works, thank you. For a bonus... when one of the counts is 0, it will not have a bar on the graph. Is there a way to force a placement for this, such that the 0 value is conveyed? Otherwise it's not apparent that two values are being compared.&lt;/P&gt;</description>
    <pubDate>Wed, 13 Feb 2019 17:28:05 GMT</pubDate>
    <dc:creator>tmaurst</dc:creator>
    <dc:date>2019-02-13T17:28:05Z</dc:date>
    <item>
      <title>How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386663#M112841</link>
      <description>&lt;P&gt;I am completely stumped as to how to chart two numbers.&lt;/P&gt;

&lt;P&gt;I have two counts from two searches. I simply want to chart them side by side.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mySource AND first string I'm looking for | stats count as firstCount | appendcols [search sourcetype=mySource AND second string I'm looking for | stats count as secondCount] | chart &amp;lt;how to chart firstCount and secondCount on bar graph?&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The counts are fine and are returning the expected values. I just can't figure out how to chart them together. For instance, if I have the numbers 5 and 10, how can those show up on a simple numbered x-axis together in bar graph form?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 23:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386663#M112841</guid>
      <dc:creator>tmaurst</dc:creator>
      <dc:date>2019-02-12T23:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386664#M112842</link>
      <description>&lt;P&gt;You don't need two searches.  Put both conditions into the base search then use an eval to create a field that distinguishes each.  Use that field in the &lt;CODE&gt;chart&lt;/CODE&gt; command to show the counts.  Depending on your data, there may be other ways to do the &lt;CODE&gt;eval&lt;/CODE&gt; (a unique field in each, for instance).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=mySource ("first string I'm looking for" OR "second string I'm looking for") 
| eval split=if(match(_raw, ".*first string I'm looking for.*"), "first", "second") | chart count by split
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 12 Feb 2019 23:36:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386664#M112842</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2019-02-12T23:36:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386665#M112843</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=YouShouldAlwaysSpecifyAnIndex AND sourcetype=mySource AND ("first string" OR "second string")
| stats count(eval(searchmatch("first string"))) AS firstCount count(eval(searchmatch("seconds string"))) AS secondCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The rest is a matter of picking the right visualization and configuration options for it.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Feb 2019 23:38:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386665#M112843</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-12T23:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386666#M112844</link>
      <description>&lt;P&gt;Thanks. Why should we always use an index? I'm guessing performance related but can you be more specific as to why?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 17:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386666#M112844</guid>
      <dc:creator>tmaurst</dc:creator>
      <dc:date>2019-02-13T17:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386667#M112845</link>
      <description>&lt;P&gt;This works, thank you. For a bonus... when one of the counts is 0, it will not have a bar on the graph. Is there a way to force a placement for this, such that the 0 value is conveyed? Otherwise it's not apparent that two values are being compared.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 17:28:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386667#M112845</guid>
      <dc:creator>tmaurst</dc:creator>
      <dc:date>2019-02-13T17:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386668#M112846</link>
      <description>&lt;P&gt;When you are not referencing an index in your search, you are relying on the &lt;CODE&gt;Indexes searched by default&lt;/CODE&gt; setting that your &lt;EM&gt;admins&lt;/EM&gt; control so this setting can be changed at any time without notice and varies from role-to-role.  This means that your search could behave very differently from user to user at the same time or for the same user across time.  This is absurdly risky and negligent on your part.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 17:34:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386668#M112846</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-13T17:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386669#M112847</link>
      <description>&lt;P&gt;Be sure to spread around the &lt;CODE&gt;UpVotes&lt;/CODE&gt; to helpful answers and comments and click &lt;CODE&gt;Accept&lt;/CODE&gt; to close your question.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 17:36:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386669#M112847</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-13T17:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386670#M112848</link>
      <description>&lt;P&gt;Makes sense.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 18:01:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386670#M112848</guid>
      <dc:creator>tmaurst</dc:creator>
      <dc:date>2019-02-13T18:01:26Z</dc:date>
    </item>
    <item>
      <title>Re: How do you chart two unrelated numbers?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386671#M112849</link>
      <description>&lt;P&gt;Ask a new question.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Feb 2019 18:19:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-chart-two-unrelated-numbers/m-p/386671#M112849</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-02-13T18:19:11Z</dc:date>
    </item>
  </channel>
</rss>

