<?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: Merge similar field values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289231#M87523</link>
    <description>&lt;P&gt;if you're looking for a rex command, is this what you're looking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=User mode=sed "s/\/pup\/folks\/xy\/hollow\/yellow\/.*\/usage/\/pup\/folks\/xy\/hollow\/yellow\/*\/usage/" 
| rex field=User mode=sed "s/\/pup\/police\/xy\/laptop\/MASTER\/hollow\/.*/\/pup\/police\/xy\/laptop\/MASTER\/hollow\/*/"
|stats sum(count) as total by User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 06 Oct 2017 13:28:26 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2017-10-06T13:28:26Z</dc:date>
    <item>
      <title>Merge similar field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289228#M87520</link>
      <description>&lt;P&gt;Running the following query gives me a result with different field values.&lt;/P&gt;

&lt;P&gt;index="XXXX" host="POLO*" | stats count by URL | sort-count&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;URI                                         |       count
/pup/folks/xy/hollow/yellow/red                 |       7
/pup/folks/xy/hollow/yellow/1234567/usage       |       1
/pup/police/xy/laptop/MASTER/hollow/1234567 |       1
/pup/folks/xy/hollow/yellow/1234567/usage       |       1
/pup/police/xy/laptop/MASTER/hollow/123456      |       1
/pup/folks/xy/hollow/yellow/12345/usage         |       1
/pup/folks/xy/hollow/yellow                     |       1
/pup/police/xy/laptop/MASTER/hollow/12345       |       1
/pup/folks/xy/hollow/yellow/123456/usage        |       5
/pup/folks/xy/hollow/yellow/123456/usage        |       5
/pup/folks/xy/hollow/yellow/123456/usage        |       5
/pup/police/xy/laptop/MASTER/hollow/123456      |       5
/pup/police/xy/laptop/MASTER/hollow/123456      |       5
/pup/folks/xy/hollow/yellow/123456/usage        |       4
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to show them like this? (Merge). What I have done below is take all the strings that matches "/pup/folks/xy/hollow/yellow/*/usage", and took a consolidated count.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/pup/folks/xy/hollow/yellow/*/usage                 |             22
/pup/police/xy/laptop/MASTER/hollow/*          |             13
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 12:09:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289228#M87520</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2017-10-06T12:09:06Z</dc:date>
    </item>
    <item>
      <title>Re: Merge similar field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289229#M87521</link>
      <description>&lt;P&gt;if you used a replace command, i think it will work. using _ instead of *, as we all know that * is a wildcard and I tried to escape it with \, but couldn't get it to work. might be another way, though.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|replace "/pup/folks/xy/hollow/yellow/*/usage" with "/pup/folks/xy/hollow/yellow/_/usage"
|replace "/pup/police/xy/laptop/MASTER/hollow/*" with "/pup/police/xy/laptop/MASTER/hollow/_"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 12:36:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289229#M87521</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-06T12:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: Merge similar field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289230#M87522</link>
      <description>&lt;P&gt;I should have been more clear in asking the question. &lt;/P&gt;

&lt;P&gt;A close sample is given here - &lt;A href="https://answers.splunk.com/answers/61646/combining-multivalues-together-inside-a-field.html"&gt;https://answers.splunk.com/answers/61646/combining-multivalues-together-inside-a-field.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 13:14:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289230#M87522</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2017-10-06T13:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: Merge similar field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289231#M87523</link>
      <description>&lt;P&gt;if you're looking for a rex command, is this what you're looking for:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rex field=User mode=sed "s/\/pup\/folks\/xy\/hollow\/yellow\/.*\/usage/\/pup\/folks\/xy\/hollow\/yellow\/*\/usage/" 
| rex field=User mode=sed "s/\/pup\/police\/xy\/laptop\/MASTER\/hollow\/.*/\/pup\/police\/xy\/laptop\/MASTER\/hollow\/*/"
|stats sum(count) as total by User
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 13:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289231#M87523</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-06T13:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Merge similar field values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289232#M87524</link>
      <description>&lt;P&gt;Thank You!&lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 12:30:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Merge-similar-field-values/m-p/289232#M87524</guid>
      <dc:creator>koushiknandan</dc:creator>
      <dc:date>2017-10-12T12:30:43Z</dc:date>
    </item>
  </channel>
</rss>

