<?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: Summary of stats from multiple events for each identifier based on specific columns by combining in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500771#M139427</link>
    <description>&lt;P&gt;Thanks for clarifying. Interesting to know the combination of lookup and xyseries !&lt;/P&gt;</description>
    <pubDate>Fri, 27 Mar 2020 13:54:59 GMT</pubDate>
    <dc:creator>pavanml</dc:creator>
    <dc:date>2020-03-27T13:54:59Z</dc:date>
    <item>
      <title>Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500766#M139422</link>
      <description>&lt;P&gt;Hi.. I have a dataset with each identifier having multiple events. Each event can have a TransactionType which can have one of the two values (Solution or Applied). And each event will have a Status with one of the 3 values (Success/Failure/Exception). I need to generate a summary statistics with one row for each identifier. And counts of Success/Failure/Exception for each of the two transactiontype values and this has to come in the columns as shown in the Image.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/8581i6091130D224152D8/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 14:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500766#M139422</guid>
      <dc:creator>pavanml</dc:creator>
      <dc:date>2020-03-26T14:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500767#M139423</link>
      <description>&lt;P&gt;This was a good challenge.  To make sure all columns are present in the results I created a lookup table called "AllColumns.csv" that consists of all combinations of TransactionType and Status like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Identifier TransactionType Status
0000    solution    success
0000    solution    failure
0000    solution    exception
0000    applied success
0000    applied failure
0000    applied exception
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This dummy data is filtered out near the end of the query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search for data&amp;gt; 
`comment("Read in dummy data to make sure all columns are displayed"`
| inputlookup append=true allColumns.csv 
`comment("Merge the TransactionType and Status fields")`
| strcat TransactionType "(" Status ")" transStat 
`comment("Count the results")`
| stats count by Identifier,transStat 
`comment("Convert the stats output into a table")`
| xyseries Identifier transStat count 
`comment("Fill in missing values")`
| fillnull value=0 
`comment("Remove the dummy data")`
| where identifier!="0000" 
`comment("Display the results in the desired order")`
| table identifier "Solution(Success)", "Solution(Failure)", "Solution(Exception)", "Applied(Success)", "Applied(Failure)", "Applied(Exception)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 15:57:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500767#M139423</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-03-26T15:57:31Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500768#M139424</link>
      <description>&lt;P&gt;One of the best examples of using xyseries I've ever seen!  Bravo!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:07:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500768#M139424</guid>
      <dc:creator>rmmiller</dc:creator>
      <dc:date>2020-03-26T16:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500769#M139425</link>
      <description>&lt;P&gt;hi @pavanml,&lt;/P&gt;

&lt;P&gt;Count events using stats command and use xyseries command to format results. Try this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index = &amp;lt;index_name&amp;gt;
| stats count by Identifier, TransactionType, Status 
| eval TransactionType = TransactionType." (".Status.")" 
| xyseries Identifier, TransactionType, count 
| fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw="Identifier, TransactionType, Status
 1234, Solution, Success
 1234, Solution, Success
 1234, Applied, Fail
 4567, Solution, Fail
 4567, Solution, Excepetion" 
| multikv forceheader=1 
| stats count by Identifier, TransactionType, Status 
| eval TransactionType = TransactionType." (".Status.")" 
| xyseries Identifier, TransactionType, count 
| fillnull value=0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Mar 2020 16:15:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500769#M139425</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-26T16:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500770#M139426</link>
      <description>&lt;P&gt;Thanks for the response. Also I have an additional challenge along with this which I have posted at below link. If possible please clarify:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/813163/how-to-combine-an-xyseries-output-with-other-aggre.html?minQuestionBodyLength=80"&gt;https://answers.splunk.com/answers/813163/how-to-combine-an-xyseries-output-with-other-aggre.html?minQuestionBodyLength=80&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:53:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500770#M139426</guid>
      <dc:creator>pavanml</dc:creator>
      <dc:date>2020-03-27T13:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: Summary of stats from multiple events for each identifier based on specific columns by combining</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500771#M139427</link>
      <description>&lt;P&gt;Thanks for clarifying. Interesting to know the combination of lookup and xyseries !&lt;/P&gt;</description>
      <pubDate>Fri, 27 Mar 2020 13:54:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Summary-of-stats-from-multiple-events-for-each-identifier-based/m-p/500771#M139427</guid>
      <dc:creator>pavanml</dc:creator>
      <dc:date>2020-03-27T13:54:59Z</dc:date>
    </item>
  </channel>
</rss>

