<?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 text in Splunk table? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497203#M8948</link>
    <description>&lt;P&gt;Try this. This will display results exactly as you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Type=if(Country="US", Type, Country), Country=if(Country="US", Country, "") 
| table Type, Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to group Country by Type, then use stats.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(Country) as Country by Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw=" Type Country
Reporting US
reporting CAN
Reporting IND
Consolidated US
Consolidate CAN
Consolidated IND" 
| multikv forceheader=1 
| eval Type=if(Country="US", Type, Country), Country=if(Country="US", Country, "") 
| table Type, Country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 18 Mar 2020 01:48:10 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2020-03-18T01:48:10Z</dc:date>
    <item>
      <title>How to merge text in Splunk table?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497202#M8947</link>
      <description>&lt;P&gt;Have a table like this , how &lt;/P&gt;

&lt;P&gt;Type                            Country                    &lt;/P&gt;

&lt;P&gt;Reporting                     US&lt;BR /&gt;
reporting                      CAN&lt;BR /&gt;
Reporting                    IND&lt;BR /&gt;
COnsolidated            US&lt;BR /&gt;
Consolidate                CAN&lt;BR /&gt;
Consolidated               IND&lt;/P&gt;

&lt;P&gt;How do i display as &lt;/P&gt;

&lt;P&gt;Type                            Country                    &lt;/P&gt;

&lt;P&gt;Reporting                     US&lt;BR /&gt;
                                      CAN&lt;BR /&gt;
                                    IND&lt;BR /&gt;
Consolidated            US&lt;BR /&gt;
                                    CAN&lt;BR /&gt;
                                    IND&lt;/P&gt;</description>
      <pubDate>Tue, 17 Mar 2020 23:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497202#M8947</guid>
      <dc:creator>ashanka</dc:creator>
      <dc:date>2020-03-17T23:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge text in Splunk table?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497203#M8948</link>
      <description>&lt;P&gt;Try this. This will display results exactly as you want.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Type=if(Country="US", Type, Country), Country=if(Country="US", Country, "") 
| table Type, Country
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you want to group Country by Type, then use stats.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats values(Country) as Country by Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw=" Type Country
Reporting US
reporting CAN
Reporting IND
Consolidated US
Consolidate CAN
Consolidated IND" 
| multikv forceheader=1 
| eval Type=if(Country="US", Type, Country), Country=if(Country="US", Country, "") 
| table Type, Country
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Mar 2020 01:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497203#M8948</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-03-18T01:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to merge text in Splunk table?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497204#M8949</link>
      <description>&lt;P&gt;@ashanka as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval _raw = "Type Country
Reporting US
reporting CAN
Reporting IND
COnsolidated US
Consolidate CAN
Consolidated IND" 
| multikv forceheader=1 
| eval Type_new = upper(substr(Type, 0, 1)) + lower(substr(Type, 2)) 
| eval Type = case(match(Type_new, "Reporting"), "Reporting", match(Type_new, "Consolidate(d)?"), "Consolidated")
| stats list(Country) as Country By Type
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will return: &lt;BR /&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/8554i05C314DC0C25B01B/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>Wed, 18 Mar 2020 02:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-merge-text-in-Splunk-table/m-p/497204#M8949</guid>
      <dc:creator>anmolpatel</dc:creator>
      <dc:date>2020-03-18T02:58:17Z</dc:date>
    </item>
  </channel>
</rss>

