<?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: Group search results by result-values/-wildcards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295065#M89057</link>
    <description>&lt;P&gt;Thanks for this proposal... please notice my answer above, the values were only examples. I need to freely define group names and fill these grouped values by wildcard or OR search clauses.&lt;/P&gt;</description>
    <pubDate>Wed, 28 Mar 2018 12:34:32 GMT</pubDate>
    <dc:creator>hse8fe</dc:creator>
    <dc:date>2018-03-28T12:34:32Z</dc:date>
    <item>
      <title>Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295059#M89051</link>
      <description>&lt;P&gt;Hello Splunk Community,&lt;/P&gt;

&lt;P&gt;I have an selected field available called OBJECT_TYPE which could contain several values.&lt;BR /&gt;
For example the values a_1, a_2, a_3, b_1, b_2, c_1, c_2, c_3, c_4&lt;BR /&gt;
Now I want to get a grouped count result by a*, b*, c*. Which could be visualized in a pie chart.&lt;/P&gt;

&lt;P&gt;How I can achieve this?&lt;BR /&gt;
Means a result table like&lt;/P&gt;

&lt;H2&gt;Type | Count | %&lt;/H2&gt;

&lt;P&gt;a        | 300    | 30&lt;BR /&gt;&lt;BR /&gt;
b        | 200    | 20&lt;BR /&gt;
c        | 500    | 50&lt;/P&gt;

&lt;P&gt;Thanks a lot for you support!&lt;BR /&gt;
Sebastian&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:43:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295059#M89051</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2020-09-29T18:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295060#M89052</link>
      <description>&lt;P&gt;Hey&lt;/P&gt;

&lt;P&gt;You can use rex to extract the common value from your values:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Yoursearch | rex field=OBJECT_TYPES "(?&amp;lt;Common&amp;gt;[^\_]*)"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then do stats count by common &lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 11:59:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295060#M89052</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-28T11:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295061#M89053</link>
      <description>&lt;P&gt;I think the easiest way would be to create a new field that is just the piece you want of the object type.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Object_Group=substr(OBJECT_TYPES,1,1) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can do your transforming command using the Object_Group field&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 12:02:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295061#M89053</guid>
      <dc:creator>kmaron</dc:creator>
      <dc:date>2018-03-28T12:02:41Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295062#M89054</link>
      <description>&lt;P&gt;@hse8fe, please try the following search on the field &lt;CODE&gt;OBJECT_TYPES&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourBaseSearch&amp;gt;
| stats count by OBJECT_TYPES
| eval Type= replace(OBJECT_TYPES,"([^_]+)\_.+","\1")
| stats sum(count) as Count by Type
| eventstats sum(Count) as Total
| eval "%"=round((Count/Total)*100,1)
| fields - Total
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 12:10:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295062#M89054</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-03-28T12:10:12Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295063#M89055</link>
      <description>&lt;P&gt;Thanks a lot for your super fast reaction &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Anyway I don't see the solution....&lt;BR /&gt;
I explain again:&lt;BR /&gt;
The field OBJECT_TYPE is already available in the selected fields. The value names were only examples.&lt;/P&gt;

&lt;P&gt;Realistic values of the field OBJECT_TYPE: &lt;BR /&gt;
WWV_DELVRY, WWV_DELFOR  &lt;EM&gt;--&amp;gt; should be grouped to WWV&lt;/EM&gt;&lt;BR /&gt;
O2int, int, intAS2                        &lt;EM&gt;--&amp;gt; should be grouped to int&lt;/EM&gt;&lt;BR /&gt;
IFTSTA, IFCSUM                           &lt;EM&gt;--&amp;gt; should be grouped to TMS&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Result table should look like&lt;/P&gt;

&lt;H2&gt;Type | Count | %&lt;/H2&gt;

&lt;P&gt;WWV | 300 | 30&lt;BR /&gt;
int      | 200 | 20&lt;BR /&gt;
TMS   | 500 | 50&lt;/P&gt;

&lt;P&gt;Thanks again for your support!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295063#M89055</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2020-09-29T18:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295064#M89056</link>
      <description>&lt;P&gt;Thanks for this proposal... please notice my answer above, the value names were only examples. I need to freely define group names and fill these grouped values by wildcard or OR search clauses.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 12:19:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295064#M89056</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2018-03-28T12:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295065#M89057</link>
      <description>&lt;P&gt;Thanks for this proposal... please notice my answer above, the values were only examples. I need to freely define group names and fill these grouped values by wildcard or OR search clauses.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 12:34:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295065#M89057</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2018-03-28T12:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295066#M89058</link>
      <description>&lt;P&gt;You can try this,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults | eval test="a_1, a_2, a_3, b_1, b_2, c_1, c_2, c_3, c_4" | makemv delim="," test | mvexpand test | eval type=if(like(test, "%a%"), "a", if(like(test, "%b%"), "b", "c")) | stats count by type
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Mar 2018 13:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295066#M89058</guid>
      <dc:creator>vinod94</dc:creator>
      <dc:date>2018-03-28T13:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295067#M89059</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;thank for all of your inputs. It helped me a lot. Anyway the simple solution is to use the magic "transpose" command which is converting the result colums of a single row to multiple rows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;stats 
count(eval(like(OBJECT_TYPE,"WWV%"))) AS WWV 
count(eval(like(OBJECT_TYPE,"IFT%") OR like(OBJECT_TYPE,"IFC%") OR like(OBJECT_TYPE,"XML_INVOIC%") OR like(OBJECT_TYPE,"UTILMD%") OR like(OBJECT_TYPE,"XML_EPCIS"))) AS TMS 
count(eval(like(OBJECT_TYPE,"%VMI"))) AS VMI
count(eval(like(OBJECT_TYPE,"INVRPTE%")OR like(OBJECT_TYPE,"DELJIT_SUPO_EMS") OR like(OBJECT_TYPE,"APERAK"))) AS EMS
count(eval(like(OBJECT_TYPE,"DELFOR") OR like(OBJECT_TYPE,"DESADV") OR like(OBJECT_TYPE,"vda%") OR like(OBJECT_TYPE,"X12%") OR like(OBJECT_TYPE,"ORD%") OR like(OBJECT_TYPE,"INVRPT") OR like(OBJECT_TYPE,"edl") OR like(OBJECT_TYPE,"DELJIT"))) AS Procurment 
| transpose
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See as well: &lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 13:54:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295067#M89059</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2018-03-28T13:54:11Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295068#M89060</link>
      <description>&lt;P&gt;@hse8fe If your problem is resolved, please accept an answer to help future readers.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 14:27:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295068#M89060</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-03-28T14:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Group search results by result-values/-wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295069#M89061</link>
      <description>&lt;P&gt;Thanks to all your inputs, this helped a lot!!!&lt;BR /&gt;
But the magic command which is solving my issue is &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.2/SearchReference/Transpose"&gt;Transpose&lt;/A&gt;&lt;BR /&gt;
 "Use the transpose command to convert the columns of the single row into multiple rows. "&lt;/P&gt;</description>
      <pubDate>Wed, 28 Mar 2018 14:51:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-search-results-by-result-values-wildcards/m-p/295069#M89061</guid>
      <dc:creator>hse8fe</dc:creator>
      <dc:date>2018-03-28T14:51:54Z</dc:date>
    </item>
  </channel>
</rss>

