<?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: How to merge rows in a table column if the value is repeating? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169463#M48429</link>
    <description>&lt;P&gt;If I could upvote this twice I would. Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 30 Jul 2015 05:10:49 GMT</pubDate>
    <dc:creator>toby_meyer</dc:creator>
    <dc:date>2015-07-30T05:10:49Z</dc:date>
    <item>
      <title>How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169457#M48423</link>
      <description>&lt;P&gt;I need to merge rows in a column if the value is repeating.&lt;/P&gt;

&lt;P&gt;My search output gives me a table containing &lt;CODE&gt;Subsystem&lt;/CODE&gt;, &lt;CODE&gt;ServiceName&lt;/CODE&gt; and its &lt;CODE&gt;count&lt;/CODE&gt;. It will show as below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Subsystem     ServiceName      count
A             booking           300
A             checkin            20
A             seatassignment       3
B             booking            10
B             AAA                12
B             BBB                34
B             CCC                54
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I want the output as: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Subsystem      ServiceName    count
A             booking          300
               checkin          20
               seatassignment     3
B             booking           10
               AAA              12
               BBB                34
               CCC              54
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I tried using this search: &lt;CODE&gt;search...| stats values(ServiceName), count by Subsystem&lt;/CODE&gt;, but it gives me wrong subsystem count. I want the count of each of the services used by subsystem.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 09:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169457#M48423</guid>
      <dc:creator>jagadish85</dc:creator>
      <dc:date>2015-04-30T09:37:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169458#M48424</link>
      <description>&lt;P&gt;To be clear:  Like Merge Centre in Excel , I need  to merge Subsytem values and the count should be the count of services called by subsystem.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 09:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169458#M48424</guid>
      <dc:creator>jagadish85</dc:creator>
      <dc:date>2015-04-30T09:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169459#M48425</link>
      <description>&lt;P&gt;You may try this - &lt;/P&gt;

&lt;P&gt;index=xxx | stats count by ServiceName, Subsystem  | stats list(ServiceName) , list(Subsystem) &lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 10:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169459#M48425</guid>
      <dc:creator>satishsdange</dc:creator>
      <dc:date>2015-04-30T10:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169460#M48426</link>
      <description>&lt;P&gt;It is not working. Not showing me the count. Also it gives me a single row with all the ServiceName in one column and all the subsystem in another.&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 11:06:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169460#M48426</guid>
      <dc:creator>jagadish85</dc:creator>
      <dc:date>2015-04-30T11:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169461#M48427</link>
      <description>&lt;P&gt;satishsdange is close I think. I will include what I expect your existing search is that is giving you your current output.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=foo | stats count by Subsystem ServiceName | stats list(ServiceName) as ServiceName list(count) as Count by Subsystem
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Because of how list works (shows values as it sees them) any sorting you want to do will need to be done before the second stats command. For example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=foo | stats count by Subsystem ServiceName | sort -count | stats list(ServiceName) as ServiceName list(count) as Count by Subsystem
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Apr 2015 11:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169461#M48427</guid>
      <dc:creator>Runals</dc:creator>
      <dc:date>2015-04-30T11:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169462#M48428</link>
      <description>&lt;P&gt;Thanks to both of you ... it works&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2015 11:55:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169462#M48428</guid>
      <dc:creator>jagadish85</dc:creator>
      <dc:date>2015-04-30T11:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169463#M48429</link>
      <description>&lt;P&gt;If I could upvote this twice I would. Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jul 2015 05:10:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169463#M48429</guid>
      <dc:creator>toby_meyer</dc:creator>
      <dc:date>2015-07-30T05:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge rows in a table column if the value is repeating?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169464#M48430</link>
      <description>&lt;P&gt;| streamstats count by Subsystem | eval Subsystem=if(count==1,Subsystem,"")&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 02:51:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-merge-rows-in-a-table-column-if-the-value-is-repeating/m-p/169464#M48430</guid>
      <dc:creator>AndreyHS</dc:creator>
      <dc:date>2017-07-20T02:51:42Z</dc:date>
    </item>
  </channel>
</rss>

