<?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 I only show some fields values in my chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271144#M81639</link>
    <description>&lt;P&gt;You need to specify the field name vs doing full text search across all data with the name.&lt;/P&gt;

&lt;P&gt;... (customer_id="john" OR customer_id="Bill" OR customer_id="name") ...&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 09:48:54 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2020-09-29T09:48:54Z</dc:date>
    <item>
      <title>How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271143#M81638</link>
      <description>&lt;P&gt;I have a search like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=pupi (some rex extractions) |chart count by customer_id, name_EVENTS  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which gives me something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;customer_iD     AP_ERROR  |  AP_OK  |  DOWN_ERROR 
John            50           70        78
Bill thomas     45           25        38
.
.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thing is that Customer ID field has like 100 different values. I just want a table to show only 6 of them (not with TOP, not arbitrarily) 6 names that I need to choose and show. I tried to put those names in the search with OR "john" OR "Bill" OR "name", but it brings other logs that I don't want.  Is this possible to do with eval? something like IF value is "John" show in chart if it is "the ones I want to show"  ,show it, else don't show it?&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 19:19:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271143#M81638</guid>
      <dc:creator>guillecasco</dc:creator>
      <dc:date>2016-05-26T19:19:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271144#M81639</link>
      <description>&lt;P&gt;You need to specify the field name vs doing full text search across all data with the name.&lt;/P&gt;

&lt;P&gt;... (customer_id="john" OR customer_id="Bill" OR customer_id="name") ...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271144#M81639</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T09:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271145#M81640</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;P&gt;index=pupi (some rex extractions)|eval wanted=case(Custome_id=JOHN,"OK" ,Custome_id=JOHN,"OK" ,Custome_id=JOHN,"OK" ,Custome_id=JOHN,"OK" ,Custome_id=JOHN,"OK" ,Custome_id=JOHN,"OK" ,1=1,"notok"|search wanted="OK" |chart count by customer_id, name_EVENTS&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:47:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271145#M81640</guid>
      <dc:creator>splunkton</dc:creator>
      <dc:date>2020-09-29T09:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271146#M81641</link>
      <description>&lt;P&gt;I did that but it brings me data that i don´t want. Evidently the name i want, are in other kinds of logs, that´s why i´m trying to do it with eval (i don´t know which other way if not)&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 19:45:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271146#M81641</guid>
      <dc:creator>guillecasco</dc:creator>
      <dc:date>2016-05-26T19:45:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271147#M81642</link>
      <description>&lt;P&gt;Yeah you can do that with case statement like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval AP_ERROR=case(customer_id==john AND otherfield==whatever,AP_ERROR,customer_id==bob AND otherfield==something,AP_ERROR)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What this will do is if the customer_id is john and the otherfield is whatever, AP_ERROR will equal whatever AP_ERROR is in that event,  ... and if customer_id is bob and otherfield is something, it will also be whatever AP_ERROR is in that event  ...  otherwise AP_ERROR will be null.  Then when you start adding all these events up, the null values will not count as 0 or anything at all.&lt;/P&gt;

&lt;P&gt;case([condition(s)1],"[value if condition1=true]",[condition(s)2],"[value if condition2=true]") ... so on&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.7/SearchReference/CommonEvalFunctions" target="_blank"&gt;http://docs.splunk.com/Documentation/Splunk/6.0.7/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;if you want "[value if condition=true]" to be a field's value, just remove the double quotes so that its like this:&lt;/P&gt;

&lt;P&gt;case([condition(s)1],fieldname,[condition(s)2],fieldname) ... so on&lt;/P&gt;

&lt;P&gt;I hope all that helps&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:49:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271147#M81642</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T09:49:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271148#M81643</link>
      <description>&lt;P&gt;great thank you my friend&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 18:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271148#M81643</guid>
      <dc:creator>guillecasco</dc:creator>
      <dc:date>2016-05-27T18:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: How do I only show some fields values in my chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271149#M81644</link>
      <description>&lt;P&gt;You're very welcome!&lt;/P&gt;</description>
      <pubDate>Fri, 27 May 2016 23:03:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-only-show-some-fields-values-in-my-chart/m-p/271149#M81644</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-27T23:03:29Z</dc:date>
    </item>
  </channel>
</rss>

