<?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 change the name of the source path that is being shown in the results? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477799#M82008</link>
    <description>&lt;P&gt;Hi, I was away for a few days. Is your issue resolved now ?&lt;/P&gt;</description>
    <pubDate>Mon, 25 Nov 2019 13:05:55 GMT</pubDate>
    <dc:creator>arjunpkishore5</dc:creator>
    <dc:date>2019-11-25T13:05:55Z</dc:date>
    <item>
      <title>How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477789#M81998</link>
      <description>&lt;P&gt;I have a search that gives me two groups separated by two different sources but I do not want to have the source path showing, I want to rename it, how can I do that?&lt;/P&gt;

&lt;P&gt;For example, to show sourcegroup1 and sourcegroup2?&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/7915i0029F6B0C4BA7D09/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;Thanks &lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2019 16:25:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477789#M81998</guid>
      <dc:creator>diabinho</dc:creator>
      <dc:date>2019-11-08T16:25:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477790#M81999</link>
      <description>&lt;P&gt;example&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval source="source1/log.log" 
| rex field=source "^(?P&amp;lt;source_group&amp;gt;[^\/]+)" 
| fields - source
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Nov 2019 16:58:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477790#M81999</guid>
      <dc:creator>starcher</dc:creator>
      <dc:date>2019-11-08T16:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477791#M82000</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults 
| eval source="source1/log.log" 
| rex field=source mode=sed "s/^[a-zA-Z]+(\d+)\/.*/sourcegroup\1/g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 08 Nov 2019 17:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477791#M82000</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2019-11-08T17:05:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477792#M82001</link>
      <description>&lt;P&gt;Multiple ways to approach this&lt;/P&gt;

&lt;P&gt;If your list is small, you can use a simple case statement&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval source=case(match(source, "source1"), "sourcegroup1", match(source, "source2"), "sourcegroup2")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If your list is larger, use a lookup file with the mappings&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| lookup &amp;lt;lookupfile&amp;gt; &amp;lt;source-old&amp;gt; as source OUTPUT &amp;lt;source-new &amp;gt;as source
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Need to extract part of your source as the new source? refer to the &lt;CODE&gt;rex&lt;/CODE&gt; examples provided by @starcher and @mayurr98 &lt;/P&gt;

&lt;P&gt;Case - &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/ConditionalFunctions"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/ConditionalFunctions&lt;/A&gt;&lt;BR /&gt;
Lookup - &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Lookup"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.0/SearchReference/Lookup&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2019 19:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477792#M82001</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-09T19:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477793#M82002</link>
      <description>&lt;P&gt;@arjunpkishore5 it almost did the trick, the first approach. But now it does show anything. I get the column "source" but nothing on each line (no sourcegroup1 or sourcegroup2).&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 12:11:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477793#M82002</guid>
      <dc:creator>diabinho</dc:creator>
      <dc:date>2019-11-10T12:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477794#M82003</link>
      <description>&lt;P&gt;Is the value of source in mixed case? As in , has both upper and lower case characters?&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 13:00:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477794#M82003</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-10T13:00:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477795#M82004</link>
      <description>&lt;P&gt;Yes they do, in both sources.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 13:06:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477795#M82004</guid>
      <dc:creator>diabinho</dc:creator>
      <dc:date>2019-11-10T13:06:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477796#M82005</link>
      <description>&lt;P&gt;in that case, please change the case statement to the following. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval source=case(match(lower(source), "source1"), "sourcegroup1", match(lower(source), "source2"), "sourcegroup2")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;match is case sensitive. so I'm force converting the value to lower case so that they match to the lowercase pattern&lt;/P&gt;</description>
      <pubDate>Sun, 10 Nov 2019 22:51:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477796#M82005</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-10T22:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477797#M82006</link>
      <description>&lt;P&gt;Didnt work, keep getting them in blank.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 07:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477797#M82006</guid>
      <dc:creator>diabinho</dc:creator>
      <dc:date>2019-11-11T07:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477798#M82007</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=source mode=sed "s/\/.*$//"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 16 Nov 2019 22:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477798#M82007</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-11-16T22:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the name of the source path that is being shown in the results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477799#M82008</link>
      <description>&lt;P&gt;Hi, I was away for a few days. Is your issue resolved now ?&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2019 13:05:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-change-the-name-of-the-source-path-that-is-being-shown-in/m-p/477799#M82008</guid>
      <dc:creator>arjunpkishore5</dc:creator>
      <dc:date>2019-11-25T13:05:55Z</dc:date>
    </item>
  </channel>
</rss>

