<?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 How to combine field values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674430#M230858</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hi experts,&amp;nbsp;I want to just combine these location sites - "HU1","IA2","IB0 and create new &lt;STRONG&gt;AM&lt;/STRONG&gt; site.&lt;/P&gt;&lt;P&gt;I tried this query, it works but it shows only new site. How to see&amp;nbsp;the all original sites along with the new site in location field?&lt;BR /&gt;|search location IN ("HU1","IA2","IB0")&lt;BR /&gt;|eval row=if(location IN ("HU1","IA2","IB0"),"AM",location)&lt;BR /&gt;|stats c by row.&lt;/P&gt;&lt;P&gt;How to solve any idea?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jan 2024 19:49:51 GMT</pubDate>
    <dc:creator>Muthu_Vinith</dc:creator>
    <dc:date>2024-01-16T19:49:51Z</dc:date>
    <item>
      <title>How to combine field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674430#M230858</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hi experts,&amp;nbsp;I want to just combine these location sites - "HU1","IA2","IB0 and create new &lt;STRONG&gt;AM&lt;/STRONG&gt; site.&lt;/P&gt;&lt;P&gt;I tried this query, it works but it shows only new site. How to see&amp;nbsp;the all original sites along with the new site in location field?&lt;BR /&gt;|search location IN ("HU1","IA2","IB0")&lt;BR /&gt;|eval row=if(location IN ("HU1","IA2","IB0"),"AM",location)&lt;BR /&gt;|stats c by row.&lt;/P&gt;&lt;P&gt;How to solve any idea?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 19:49:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674430#M230858</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-01-16T19:49:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674433#M230860</link>
      <description>&lt;P&gt;When describing a problem, make sure to use consistent terms and explain new terms as you introduce them. &amp;nbsp;I assume that "original sites" means &lt;SPAN&gt;"HU1","IA2", and "IB0". &amp;nbsp;Is this correct?&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;The search logic seems opposite to what you are looking for. &amp;nbsp;Try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|search location IN ("HU1","IA2","IB0")
|eval row=if(location IN ("HU1","IA2","IB0"),location,"AM")
|stats c by row.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 19:59:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674433#M230860</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-16T19:59:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674436#M230861</link>
      <description>&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/33901"&gt;@yuanliu&lt;/a&gt;&amp;nbsp;Let's assume for example&amp;nbsp;&lt;/SPAN&gt;in my data I'm having loction sites - AB,AC,AD,AF. I want new location that is &lt;STRONG&gt;AM.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;Where&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;AM&amp;nbsp;&lt;/STRONG&gt;location should be the combination of (AB,AC,AD,AF)&lt;/P&gt;&lt;P&gt;Like this i need:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Muthu_Vinith_0-1705436049444.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28958i5C33A699B0AA4004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Muthu_Vinith_0-1705436049444.png" alt="Muthu_Vinith_0-1705436049444.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried this query as you mentioned earlier, but it doesn't work.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2024 20:22:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674436#M230861</guid>
      <dc:creator>Muthu_Vinith</dc:creator>
      <dc:date>2024-01-16T20:22:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to combine field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674450#M230864</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;location that is &lt;STRONG&gt;AM.&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;Where&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;AM&amp;nbsp;&lt;/STRONG&gt;location should be the combination of (AB,AC,AD,AF)&lt;P&gt;Like this i need:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Muthu_Vinith_0-1705436049444.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/28958i5C33A699B0AA4004/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Muthu_Vinith_0-1705436049444.png" alt="Muthu_Vinith_0-1705436049444.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;First, "the combination of (AB,AC,AD,AF)" is NOT "AM" in your illustration. &amp;nbsp;The illustration is the opposite of what you described. (Also, please use text table instead of screenshot.)&lt;/P&gt;&lt;P&gt;Second, for your initial question, I notice that you filter for &lt;SPAN&gt;"HU1","IA2","IB0". &amp;nbsp;Of course you will only get whatever definition you give for these three. &amp;nbsp;I think what you wanted is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` |search location IN ("HU1","IA2","IB0")```
``` ^^^ no filtering ```
|eval row=if(location IN ("HU1","IA2","IB0"),location,"AM")
|stats c by row&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But back to your new example. &amp;nbsp;Here is an emulation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="Location
AB
AC
AD
AE
AF
AG
AH"
``` data emulation above ```
| eval "New Location" = if(Location IN ("AB","AC","AD","AE","AF"),Location,"AM")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Location&lt;/TD&gt;&lt;TD&gt;New Location&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;TD&gt;AB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AC&lt;/TD&gt;&lt;TD&gt;AC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AD&lt;/TD&gt;&lt;TD&gt;AD&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AE&lt;/TD&gt;&lt;TD&gt;AE&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AF&lt;/TD&gt;&lt;TD&gt;AF&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AG&lt;/TD&gt;&lt;TD&gt;AM&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AH&lt;/TD&gt;&lt;TD&gt;AM&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Is this what you illustrated?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 04:12:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-combine-field-values/m-p/674450#M230864</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-01-17T04:12:49Z</dc:date>
    </item>
  </channel>
</rss>

