<?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: stats usage to display output as follows in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83194#M21161</link>
    <description>&lt;P&gt;hi! i will award a 50 karma bounty to the first person to provide a good/correct answer to this question!&lt;/P&gt;</description>
    <pubDate>Wed, 14 Nov 2012 00:15:15 GMT</pubDate>
    <dc:creator>piebob</dc:creator>
    <dc:date>2012-11-14T00:15:15Z</dc:date>
    <item>
      <title>stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83191#M21158</link>
      <description>&lt;P&gt;I have a table like this ..&lt;/P&gt;

&lt;P&gt;Table 1 : Information to be searched &lt;/P&gt;

&lt;H2&gt;**Company A | Company B&lt;/H2&gt;

&lt;P&gt;abc            xyz&lt;BR /&gt;
lmn            pqr&lt;BR /&gt;
def            pgf**&lt;/P&gt;

&lt;P&gt;Where the values mentioned inside the table are searchparameters . Now i need the count of the search parameters in splunk like this ..&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Table 2: Output&lt;/STRONG&gt;&lt;BR /&gt;
&lt;STRONG&gt;Company A | Count A | Company B | Count B&lt;BR /&gt;
abc          30        xyz         10&lt;BR /&gt;
lmn          40        pqr         23&lt;BR /&gt;&lt;BR /&gt;
def          50        pgf         29&lt;/STRONG&gt;   &lt;/P&gt;

&lt;P&gt;my sourcetype is "A".&lt;/P&gt;

&lt;P&gt;sourcetype="A"  abc | stats count as Count A  &lt;/P&gt;

&lt;P&gt;has given abc count..I need count for all the values in A and B mentioned in Table 1 as in Table 2.i.e Table 2 should be the output for my search results...How do i accomplish this..please help..&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2012 18:55:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83191#M21158</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2012-06-25T18:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83192#M21159</link>
      <description>&lt;P&gt;Explain the table more clearly. Is the table itself one single event in the input? How exactly does the raw data that you're operating on look like?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jun 2012 19:12:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83192#M21159</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-06-25T19:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83193#M21160</link>
      <description>&lt;P&gt;the raw contains these terms &lt;STRONG&gt;abc ,xyz, lmn, pqr, def pgf&lt;/STRONG&gt; . where abc lmn def belong to company A and xyz pqr def belong to company B. Now i need to know the count of these searchs like the table showed above...&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jun 2012 13:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83193#M21160</guid>
      <dc:creator>rakesh_498115</dc:creator>
      <dc:date>2012-06-29T13:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83194#M21161</link>
      <description>&lt;P&gt;hi! i will award a 50 karma bounty to the first person to provide a good/correct answer to this question!&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 00:15:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83194#M21161</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2012-11-14T00:15:15Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83195#M21162</link>
      <description>&lt;P&gt;Quick and dirty answer for the bounty reward. " dead or alive"&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype="A"  NOT "companyA" NOT "------"&lt;BR /&gt;
| rex "^(?&amp;lt;companyA&amp;gt;[^\s]*) (?&amp;lt;companyB&amp;gt;\w+)$"&lt;BR /&gt;
| stats dc(companyA) count(companyA) dc(companyB) count(companyB)&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 00:34:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83195#M21162</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-11-14T00:34:50Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83196#M21163</link>
      <description>&lt;P&gt;While yannK has provided a "quick and dirty", (and I borrowed portions of his answer), I think this may be closer to what you want because of the need to count by the value of companyA and companyB. This is by no means optimized, but outputs a table as seen below the search.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetyp="A" NOT "companyA" NOT "-------" | rex field=_raw "^(?&amp;lt;companyA&amp;gt;[^\s]+)(?&amp;lt;companyB&amp;gt;.*)$"|stats count(companyA) by companyA | appendcols [search sourcetyp="A" NOT "companyA" NOT "-------" | rex field=_raw "^(?&amp;lt;companyA&amp;gt;[^\s]+)(?&amp;lt;companyB&amp;gt;.*)$"|stats count(companyB) by companyB]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;My Results Table&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;companyA   count(companyA)     companyB    count(companyB)&lt;BR /&gt;
abc         3                   pgf         2&lt;BR /&gt;
def         2                   pqr         3&lt;BR /&gt;
lmn         2                   xyz         2       &lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;My Sample Data&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Company A | Company B&lt;BR /&gt;
abc            xyz&lt;BR /&gt;
lmn            pqr&lt;BR /&gt;
def            pgf&lt;BR /&gt;
abc            pqr&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 14 Nov 2012 19:10:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83196#M21163</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-11-14T19:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83197#M21164</link>
      <description>&lt;P&gt;nice complete answer.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2012 18:49:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83197#M21164</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-11-15T18:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83198#M21165</link>
      <description>&lt;P&gt;I only have my answer because of you answer &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Nov 2012 18:54:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83198#M21165</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-11-15T18:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: stats usage to display output as follows</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83199#M21166</link>
      <description>&lt;P&gt;Hello, I have browsed most of your posts. This post is probably where I got the most useful information for my research. Thanks for posting, maybe we can see more on this. Are you aware of any other websites on this subject. &lt;A href="http://tweettunnel.com/Kartikeya_1975"&gt;Kartikeya Sharma &amp;amp; Robert Vadra&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2015 12:09:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stats-usage-to-display-output-as-follows/m-p/83199#M21166</guid>
      <dc:creator>jerrythomasnyk</dc:creator>
      <dc:date>2015-10-16T12:09:50Z</dc:date>
    </item>
  </channel>
</rss>

