<?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: Multiple Values for One Tag - Only Want to Display One in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295028#M89036</link>
    <description>&lt;P&gt;Yes, there is, you can use &lt;CODE&gt;mvfilter&lt;/CODE&gt; for this.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2019 15:07:37 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2019-11-08T15:07:37Z</dc:date>
    <item>
      <title>Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295023#M89031</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I've tagged my data by location, and I am now trying to run stats on it.&lt;/P&gt;

&lt;P&gt;Problem is a location can be Manual or Automated and relate to Bank 1 or Bank 2.&lt;/P&gt;

&lt;P&gt;The issue I have is when running a stats, I get:&lt;/P&gt;

&lt;P&gt;Manual Bank 1&lt;BR /&gt;
Manual Bank 2&lt;BR /&gt;
Automated Bank 1&lt;BR /&gt;
Automated Bank 2&lt;/P&gt;

&lt;P&gt;Whereas all I want to look at is Manual vs. Automated banks. Is there a way of only displaying certain tags?&lt;BR /&gt;
If I put tag::XX!= then it doesn't run the search as the field values are tagged as both.&lt;/P&gt;

&lt;P&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:05:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295023#M89031</guid>
      <dc:creator>alylanchester</dc:creator>
      <dc:date>2017-07-04T14:05:56Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295024#M89032</link>
      <description>&lt;P&gt;Hi alylanchester,&lt;BR /&gt;
create an eval field with your condition to use in your stats, e.g. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your_search
| eval type=if(location="Manual*", "Manual","Automatic")
| stats count by type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:48:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295024#M89032</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-07-04T14:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295025#M89033</link>
      <description>&lt;P&gt;There are 9999+ locations, we have tagged them all which is why I ask, instead of doing an Eval.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:50:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295025#M89033</guid>
      <dc:creator>alylanchester</dc:creator>
      <dc:date>2017-07-04T14:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295026#M89034</link>
      <description>&lt;P&gt;You must be very, VERY careful when counting by &lt;CODE&gt;tags&lt;/CODE&gt;.  If an event has more than 1 tag (and that is almost always the case in every splunk deployment at least some of the time), that event will be counted more than once (once for each tag value).  In any case, I would do it the way that you are and then sum it up at the end by adding this to the bottom:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=mytag "^(?&amp;lt;mode&amp;gt;\S+)"
| stats sum(count) BY mode
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That being said, I would to back and redo your tags to have 2: one for &lt;CODE&gt;mode&lt;/CODE&gt; (which is either &lt;CODE&gt;Automatic&lt;/CODE&gt; or &lt;CODE&gt;Manual&lt;/CODE&gt; and one for &lt;CODE&gt;Bank&lt;/CODE&gt; which is a number).&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 15:06:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295026#M89034</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-04T15:06:42Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295027#M89035</link>
      <description>&lt;P&gt;Thanks! Yes, didn't know if there was a way of filtering tags out so only some remained active in the field set. &lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 15:10:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295027#M89035</guid>
      <dc:creator>alylanchester</dc:creator>
      <dc:date>2017-07-04T15:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple Values for One Tag - Only Want to Display One</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295028#M89036</link>
      <description>&lt;P&gt;Yes, there is, you can use &lt;CODE&gt;mvfilter&lt;/CODE&gt; for this.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 15:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Multiple-Values-for-One-Tag-Only-Want-to-Display-One/m-p/295028#M89036</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-08T15:07:37Z</dc:date>
    </item>
  </channel>
</rss>

