<?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 How to find most common tag values when each event has multiple tags? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-most-common-tag-values-when-each-event-has-multiple/m-p/336056#M175278</link>
    <description>&lt;P&gt;I've got a data source in which each item contains multiple tag fields describing the item. For simplicity's sake, we'll say each has five tags, not all of which must be used. So given this scenario:&lt;/P&gt;

&lt;P&gt;Item 1: tag1=oranges tag2=trees tag3=groves&lt;BR /&gt;
Item 2: tag1=trees tag2=apples tag3=groves&lt;BR /&gt;
Item 3: tag1=vines tag2=vineyards tag3=grapes&lt;BR /&gt;
Item 4: tag1=bowls tag2=assortments tag3=apples tag4=tangerines&lt;/P&gt;

&lt;P&gt;What search terms will tell me I've got 2 occurrences of apples, 2 of trees, 2 of groves, 1 of grapes, and so on?&lt;/P&gt;</description>
    <pubDate>Sat, 04 Mar 2017 22:05:05 GMT</pubDate>
    <dc:creator>ehennessey_splu</dc:creator>
    <dc:date>2017-03-04T22:05:05Z</dc:date>
    <item>
      <title>How to find most common tag values when each event has multiple tags?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-most-common-tag-values-when-each-event-has-multiple/m-p/336056#M175278</link>
      <description>&lt;P&gt;I've got a data source in which each item contains multiple tag fields describing the item. For simplicity's sake, we'll say each has five tags, not all of which must be used. So given this scenario:&lt;/P&gt;

&lt;P&gt;Item 1: tag1=oranges tag2=trees tag3=groves&lt;BR /&gt;
Item 2: tag1=trees tag2=apples tag3=groves&lt;BR /&gt;
Item 3: tag1=vines tag2=vineyards tag3=grapes&lt;BR /&gt;
Item 4: tag1=bowls tag2=assortments tag3=apples tag4=tangerines&lt;/P&gt;

&lt;P&gt;What search terms will tell me I've got 2 occurrences of apples, 2 of trees, 2 of groves, 1 of grapes, and so on?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Mar 2017 22:05:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-most-common-tag-values-when-each-event-has-multiple/m-p/336056#M175278</guid>
      <dc:creator>ehennessey_splu</dc:creator>
      <dc:date>2017-03-04T22:05:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to find most common tag values when each event has multiple tags?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-find-most-common-tag-values-when-each-event-has-multiple/m-p/336057#M175279</link>
      <description>&lt;P&gt;This spoofs the data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval raw="Item 1: tag1=oranges tag2=trees tag3=groves:::Item 2: tag1=trees tag2=apples tag3=groves:::Item 3: tag1=vines tag2=vineyards tag3=grapes:::Item 4: tag1=bowls tag2=assortments tag3=apples tag4=tangerines" 
| makemv delim=":::" raw 
| mvexpand raw
| rename raw AS _raw
| rex "^Item (?&amp;lt;Item&amp;gt;\d+): tag1=(?&amp;lt;tag1&amp;gt;\w+) tag2=(?&amp;lt;tag2&amp;gt;\w+) tag3=(?&amp;lt;tag3&amp;gt;\w+)(?: tag4=(?&amp;lt;tag4&amp;gt;\w+))?"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is your solution:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| fields - Item
| untable _time key value
| stats count BY value
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 05 Mar 2017 09:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-find-most-common-tag-values-when-each-event-has-multiple/m-p/336057#M175279</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-05T09:25:19Z</dc:date>
    </item>
  </channel>
</rss>

