<?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: Rename group by value in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39743#M9100</link>
    <description>&lt;P&gt;You probably want &lt;CODE&gt;replace&lt;/CODE&gt; (&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Replace"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Replace&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | replace &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt; with Google
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Aug 2012 20:37:50 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-08-20T20:37:50Z</dc:date>
    <item>
      <title>Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39742#M9099</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
   I am using splunk to monitor the performance of a number of long urls and the search strring is like : &lt;/P&gt;

&lt;P&gt;| stats max(time_in_sec), perc90(time_in_sec), perc75(time_in_sec), perc50(time_in_sec), avg(time_in_sec), min(time_in_sec), stdev(time_in_sec) by ping_url&lt;/P&gt;

&lt;P&gt;It's working fine but the url is too long to fit in the dashboard. I am wondering if there is a way to function to display the short name in the result? Thanks!&lt;/P&gt;

&lt;P&gt;e.g. RENAME &lt;A href="http://www.google.com" target="_blank"&gt;www.google.com&lt;/A&gt; AS Google&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:17:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39742#M9099</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2020-09-28T12:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39743#M9100</link>
      <description>&lt;P&gt;You probably want &lt;CODE&gt;replace&lt;/CODE&gt; (&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Replace"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Replace&lt;/A&gt; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | replace &lt;A href="https://community.splunk.com/www.google.com" target="test_blank"&gt;www.google.com&lt;/A&gt; with Google
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Aug 2012 20:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39743#M9100</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-20T20:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39744#M9101</link>
      <description>&lt;P&gt;I can see a few options;&lt;/P&gt;

&lt;P&gt;If you have a large number of URLs you can extract the significant portion with the &lt;CODE&gt;substr&lt;/CODE&gt; function. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval shorty = substr(url,40) | the_rest_of_your_search by shorty
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If you have a few loooong but fairly static urls you can set up a &lt;CODE&gt;case&lt;/CODE&gt; evaluation&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval shorty = case(url == "/long/url/number1", "long1", url == "/long/url/number2", long2, url == "really/long/url/number/3", "long3") | the_rest_of_your_search by shorty
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;See the &lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.3/SearchReference/CommonEvalFunctions"&gt;docs for eval&lt;/A&gt; for more info.&lt;/P&gt;

&lt;P&gt;If all your URLs start the same way, e.g. /this/is/the/base/directory/in/all/urls/for/the/site/page1.htm, you can make a field extraction that skips the redundant levels (or as Ayn suggests, use &lt;CODE&gt;replace&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;Hope this helps somewhat,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;

&lt;P&gt;edit: update, spelling&lt;/P&gt;</description>
      <pubDate>Mon, 20 Aug 2012 20:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39744#M9101</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-08-20T20:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39745#M9102</link>
      <description>&lt;P&gt;Thanks a lot! This is very helpful!!!&lt;BR /&gt;
I ma wondering if the CASE function supports regular expression so the search string is cleaner? e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval shorty = case(url == "*number1*", "long1", url == "*number2*", long2, url == "*number3*", "long3") | the_rest_of_your_search by shorty
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2012 13:04:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39745#M9102</guid>
      <dc:creator>shangshin</dc:creator>
      <dc:date>2012-08-21T13:04:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39746#M9103</link>
      <description>&lt;P&gt;You can use the &lt;CODE&gt;match&lt;/CODE&gt; function for this. See more info in the docs on &lt;CODE&gt;eval&lt;/CODE&gt; functions. &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/CommonEvalFunctions"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2012 13:16:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39746#M9103</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-08-21T13:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39747#M9104</link>
      <description>&lt;P&gt;I would really recommend the use of lookup tables here, that way you can always add/modidy/delete any entries there that you may use in your searches. This way you can configure in an eficient way how you want each url to be displayed in order to be readable too. &lt;/P&gt;

&lt;P&gt;Here it is some easy to follow info on the subjetc:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/knowledge/Addfieldsfromexternaldatasources"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/knowledge/Addfieldsfromexternaldatasources&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 02:45:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39747#M9104</guid>
      <dc:creator>GKC</dc:creator>
      <dc:date>2012-12-19T02:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39748#M9105</link>
      <description>&lt;P&gt;What does the 40 stand for in substr(url,40)?&lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 00:16:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39748#M9105</guid>
      <dc:creator>c48571</dc:creator>
      <dc:date>2020-05-02T00:16:29Z</dc:date>
    </item>
    <item>
      <title>Re: Rename group by value</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39749#M9106</link>
      <description>&lt;P&gt;@c48571&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/TextFunctions#substr.28X.2CY.2CZ.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;see reference&lt;/P&gt;

&lt;P&gt;and try googling &lt;CODE&gt;substr site:docs.splunk.com&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Sat, 02 May 2020 00:38:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-group-by-value/m-p/39749#M9106</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-02T00:38:36Z</dc:date>
    </item>
  </channel>
</rss>

