<?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 to limit the number of bars in a Bar Chart made with Search and Eval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163742#M46512</link>
    <description>&lt;P&gt;This just gives me a chart telling me if a user has ever succeeded or failed VS succeeded and failed; the values are all either one or two.  It doesn't split results over success and failure, and it doesn't give out the number of successes and failures.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Jun 2015 17:34:48 GMT</pubDate>
    <dc:creator>ksextonmacb</dc:creator>
    <dc:date>2015-06-24T17:34:48Z</dc:date>
    <item>
      <title>How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163738#M46508</link>
      <description>&lt;P&gt;I have a search that makes a stacked bar chart:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=authentication user!=NULL | eval myVar=if(tag=="success","success","failure") | chart count by user, myVar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search plots number of authentications per user, with each authentication attempt being split between success and failure as the colors in the stacked bar chart.&lt;/P&gt;

&lt;P&gt;However, I have a lot of users.  I want to limit the number of users this bar chart displays to some number of more active users and lump the rest in other, but documentation I've read on the matter doesn't seem to work when applied.  The &lt;CODE&gt;bins&lt;/CODE&gt; command fails outright, the &lt;CODE&gt;limit&lt;/CODE&gt; command applies to myVar instead of user no matter where I put it, and the &lt;CODE&gt;top&lt;/CODE&gt; command overwrites my &lt;CODE&gt;chart&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;I also tried using a pivot, but it seems I can't compare two tags against each other without getting other tags involved.&lt;/P&gt;

&lt;P&gt;I've also tried using a where clause, but that too is applied to myVar.  I think this simply isn't possible.&lt;/P&gt;

&lt;P&gt;I want the graph pictures below, but with only the bars with the highest count displayed.&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/402iF02EB6DFD54D36AA/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Does anyone know how I could do what I want?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2015 19:10:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163738#M46508</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-06-22T19:10:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163739#M46509</link>
      <description>&lt;P&gt;1) To get the tag count per user&lt;BR /&gt;
tag=authentication user!=NULL | eval myVar=if(tag=="success","success","failure") | stats dc(myVar) as tagCount by user&lt;/P&gt;

&lt;P&gt;2) To display in sort order (descending) by tagCount&lt;BR /&gt;
tag=authentication user!=NULL | eval myVar=if(tag=="success","success","failure") | stats dc(myVar) as tagCount by user  | sort -eventCount&lt;/P&gt;

&lt;P&gt;3) To display top 10 users (From above search)&lt;BR /&gt;
tag=authentication user!=NULL | eval myVar=if(tag=="success","success","failure") | stats dc(myVar) as tagCount by user  | sort -eventCount | head 10&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 16:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163739#M46509</guid>
      <dc:creator>vinitatsky</dc:creator>
      <dc:date>2015-06-24T16:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163740#M46510</link>
      <description>&lt;P&gt;Hi  ksextonmacb &lt;BR /&gt;
Try this search code &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=authentication user!=NULL | eval myVar=if(tag=="success","success","failure") | chart count by  myVar , user limit=8 useother="f" usenull="f"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2015 16:53:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163740#M46510</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-06-24T16:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163741#M46511</link>
      <description>&lt;P&gt;This gets me two bars, one for success and one for failure, with the color of each stacked bar corresponding to user.  I'm after a bar for each desired user, with the color of each stacked bar corresponding to the value of myVar.&lt;/P&gt;

&lt;P&gt;I do think this answer is as close as I'm going to get to what I want, though.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 17:03:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163741#M46511</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-06-24T17:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163742#M46512</link>
      <description>&lt;P&gt;This just gives me a chart telling me if a user has ever succeeded or failed VS succeeded and failed; the values are all either one or two.  It doesn't split results over success and failure, and it doesn't give out the number of successes and failures.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 17:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163742#M46512</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-06-24T17:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163743#M46513</link>
      <description>&lt;P&gt;try like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=authentication user!=NULL | chart count(eval(tag="success")) as "count tag succes",  count(eval(tag!="success")) as "count tag faillures" by   user limit=8 useother="f" usenull="f"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 Jun 2015 18:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163743#M46513</guid>
      <dc:creator>fdi01</dc:creator>
      <dc:date>2015-06-24T18:33:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163744#M46514</link>
      <description>&lt;P&gt;The limit is still not being applied to users.  This search produces the same graph as in the image with the names of the colors changed.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 18:39:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163744#M46514</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-06-24T18:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163745#M46515</link>
      <description>&lt;P&gt;the following link will be help&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/73745/max-data-points-that-charts-can-handle.html"&gt;http://answers.splunk.com/answers/73745/max-data-points-that-charts-can-handle.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2015 13:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163745#M46515</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-06-25T13:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit the number of bars in a Bar Chart made with Search and Eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163746#M46516</link>
      <description>&lt;P&gt;This search does the thing that I want.  Just change 10 to however many bars you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;tag=authentication user!=NULL AND (tag=success OR tag=failure) | eval myVar=if(tag=="success","success","failure") | chart count as Count by user, myVar | addtotals fieldname=total | sort -total | fields user failure success | head 10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like the "fields" in my chart become user, success, failure, and a few others instead of the fields in my search.  This was what caused me problems.&lt;/P&gt;

&lt;P&gt;If anyone knows how to get an "other" bar involved in all of this that'd be swell, but this is good enough.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2015 16:16:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-the-number-of-bars-in-a-Bar-Chart-made-with-Search/m-p/163746#M46516</guid>
      <dc:creator>ksextonmacb</dc:creator>
      <dc:date>2015-06-29T16:16:01Z</dc:date>
    </item>
  </channel>
</rss>

