<?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 combine 2 rows into 1 in a statistic results (table) ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499736#M139178</link>
    <description>&lt;P&gt;Thanks so much @niketnilay , that´s the idea, I´m thinking how to apply the same to the second and others columms whit CSS.&lt;/P&gt;</description>
    <pubDate>Fri, 15 May 2020 17:25:55 GMT</pubDate>
    <dc:creator>jjofret</dc:creator>
    <dc:date>2020-05-15T17:25:55Z</dc:date>
    <item>
      <title>how to combine 2 rows into 1 in a statistic results (table) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499732#M139174</link>
      <description>&lt;P&gt;Hi everyone, I would like to know if there is any way to merge or combine the results of two or more rows into one single in a table, for example:&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/8916i8901BF3B889EDCB0/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;If there any posibility to change that result for something like this:&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/8917i9115E7415E140FAA/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>Fri, 15 May 2020 13:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499732#M139174</guid>
      <dc:creator>jjofret</dc:creator>
      <dc:date>2020-05-15T13:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine 2 rows into 1 in a statistic results (table) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499733#M139175</link>
      <description>&lt;P&gt;Hello @jjofret,&lt;/P&gt;

&lt;P&gt;something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=7 
| streamstats count 
| eval Entorno = if((count % 2)=1, "test", "production")
| eval "tipo de red" = if((random() % 2)=1, "dmz", "lan") 
| eval "FW" = if((random() % 2)=1, "yes", "no") 
| fields - _time count
| stats list("tipo de red"), list("FW") by Entorno
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 14:02:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499733#M139175</guid>
      <dc:creator>PavelP</dc:creator>
      <dc:date>2020-05-15T14:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine 2 rows into 1 in a statistic results (table) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499734#M139176</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval Entorno="test","tip de red"="dmz",FW="yes" 
| append 
    [| makeresults 
    | eval Entorno="test","tip de red"="dmz",FW="no" ] 
| append 
    [| makeresults 
    | eval Entorno="test","tip de red"="lan",FW="yes" ] 
| append 
    [| makeresults 
    | eval Entorno="production","tip de red"="dmz",FW="yes" ] 
| append 
    [| makeresults 
    | eval Entorno="production","tip de red"="dmz",FW="no" ] 
| append 
    [| makeresults 
    | eval Entorno="production","tip de red"="lan",FW="yes" ] 
| append 
    [| makeresults 
    | eval Entorno="production","tip de red"="lan",FW="no" ] 
| eval temp='tip de red'.",".'FW' 
| stats list(temp) as temp by Entorno 
| rex field=temp "(?P&amp;lt;tip_de_red&amp;gt;[^,]+),(?P&amp;lt;FW&amp;gt;\S+)" 
| table Entorno "tip_de_red" FW
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 14:07:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499734#M139176</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-05-15T14:07:35Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine 2 rows into 1 in a statistic results (table) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499735#M139177</link>
      <description>&lt;P&gt;@jjofret can you try the following&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yourCurrentSearch&amp;gt;
| stats list("tipo de red") as "tipo de red" list(FW) as FW by Entorno
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want Table Formatting also the way in your example you can try the following CSS Style override where &lt;CODE&gt;table_multivalue_with_format&lt;/CODE&gt; is the &lt;CODE&gt;id&lt;/CODE&gt; of the table&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  &amp;lt;html depends="$alwaysHideCSS$"&amp;gt;
    &amp;lt;style&amp;gt;
      #table_multivalue_with_format table tbody tr td {
        padding: 1px !important;
        text-align: center !important;
      }
      #table_multivalue_with_format table tbody tr td div.multivalue-subcell{
        border-top-style: solid;
        border-left-style: solid;
        border-right-style: solid;
        text-align: center !important;
        border-width: thin;
      }
      #table_multivalue_with_format table tbody tr td div.multivalue-subcell:last-child{
        border-bottom-style: solid;
      }
    &amp;lt;/style&amp;gt;
  &amp;lt;/html&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is a run anywhere example based on Sample Data Provided:&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/8914iA0AB41AD68445E7D/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Table with Multivalue&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html depends="$alwaysHideCSS$"&amp;gt;
        &amp;lt;style&amp;gt;
          #table_multivalue_with_format table tbody tr td {
            padding: 1px !important;
            text-align: center !important;
          }
          #table_multivalue_with_format table tbody tr td div.multivalue-subcell{
            border-top-style: solid;
            border-left-style: solid;
            border-right-style: solid;
            text-align: center !important;
            border-width: thin;
          }
          #table_multivalue_with_format table tbody tr td div.multivalue-subcell:last-child{
            border-bottom-style: solid;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="table_multivalue_with_format"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults 
| eval data="test,dmz,yes;test,dmz,no;test,ian,yes;production,dmz,yes;production,dmz,no;production,ian,yes;production,ian,no;" 
| makemv data delim=";" 
| mvexpand data 
| makemv data delim="," 
| eval Entorno=mvindex(data,0),"tipo de red"=mvindex(data,1),FW=mvindex(data,2) 
| table Entorno "tipo de red" FW
| stats list("tipo de red") as "tipo de red" list(FW) as FW by Entorno&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 14:16:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499735#M139177</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-05-15T14:16:19Z</dc:date>
    </item>
    <item>
      <title>Re: how to combine 2 rows into 1 in a statistic results (table) ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499736#M139178</link>
      <description>&lt;P&gt;Thanks so much @niketnilay , that´s the idea, I´m thinking how to apply the same to the second and others columms whit CSS.&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 17:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-combine-2-rows-into-1-in-a-statistic-results-table/m-p/499736#M139178</guid>
      <dc:creator>jjofret</dc:creator>
      <dc:date>2020-05-15T17:25:55Z</dc:date>
    </item>
  </channel>
</rss>

