<?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 source in chart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98739#M25434</link>
    <description>&lt;P&gt;The location of the sourcetype for all of these logs is in the same location but each one is named differently.  such as /opt/log/sandstorm/logs/sandstorm.log, /opt/log/snowstorm/logs/snowstorm.log, etc.  I just want the main words like Sandstorm or Snowstorm to show up for source.  I'll keep trying but any other comments are welcome!&lt;/P&gt;</description>
    <pubDate>Thu, 22 Mar 2012 15:15:54 GMT</pubDate>
    <dc:creator>gnovak</dc:creator>
    <dc:date>2012-03-22T15:15:54Z</dc:date>
    <item>
      <title>Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98736#M25431</link>
      <description>&lt;P&gt;I have a dashboard that is displaying 3 charts and a table.  In the 3 charts the legend mostly consists the source path of the logs files that are being displayed in the charts.  The source path is pretty long and I'd really like to just have the source path displayed as one word describing each source.&lt;/P&gt;

&lt;P&gt;I really only want it for these charts on the dashboard and not all throughout splunk.  Anyone have an idea of what the best way to do this?  Do I have to put something in the actual search to tell splunk to relabel the source?&lt;/P&gt;

&lt;P&gt;Example:  /opt/log/sandstorm/home/dataserver.log.&lt;BR /&gt;&lt;BR /&gt;
I want it displayed in chart as just Sandstorm and not /opt/log/sandstorm/home/dataserver.log&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2012 18:03:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98736#M25431</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-03-21T18:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98737#M25432</link>
      <description>&lt;P&gt;In the search you're using to generate each graph, sometime before your stats/chart/timechart command, create a new field that holds only the last portion of the source field:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=source "/(?&amp;lt;source_short&amp;gt;[^/]+)$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then split by that field instead of by source.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Mar 2012 18:31:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98737#M25432</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-03-21T18:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98738#M25433</link>
      <description>&lt;P&gt;Well I tried doing this but I haven't seen the result I need.  My search I was using was:  sourcetype="cron_BalanceEmail" NOT host="&lt;EM&gt;.bmp2.&lt;/EM&gt;" earliest=-1d@d latest=-0d@d sent ([BalanceEmail] OR [null])   | rex field=_raw "\w+] ?(?&lt;TOTALEMAILSSENT&gt;[\d]+) of (?&lt;TOTALEMAILSTOSEND&gt;[\d]+) of email notification sent." | table source TotalEmailsToSend TotalEmailsSent | dedup source&lt;/TOTALEMAILSTOSEND&gt;&lt;/TOTALEMAILSSENT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:33:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98738#M25433</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T11:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98739#M25434</link>
      <description>&lt;P&gt;The location of the sourcetype for all of these logs is in the same location but each one is named differently.  such as /opt/log/sandstorm/logs/sandstorm.log, /opt/log/snowstorm/logs/snowstorm.log, etc.  I just want the main words like Sandstorm or Snowstorm to show up for source.  I'll keep trying but any other comments are welcome!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:15:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98739#M25434</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-03-22T15:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98740#M25435</link>
      <description>&lt;P&gt;I don't see the rex command to create a short version of the source field in there?&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:16:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98740#M25435</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-03-22T15:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98741#M25436</link>
      <description>&lt;P&gt;I didn't add that to my response because what I had didn't work.  I'm still working on it.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:29:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98741#M25436</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-03-22T15:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98742#M25437</link>
      <description>&lt;P&gt;If i add this, the results in the table are still the same:  sourcetype="cron_BalanceEmail" NOT host="&lt;EM&gt;.bmp2.&lt;/EM&gt;" earliest=-1d@d latest=-0d@d sent ([BalanceEmail] OR [null])   | rex field=_raw "\w+] ?(?&lt;TOTALEMAILSSENT&gt;[\d]+) of (?&lt;TOTALEMAILSTOSEND&gt;[\d]+) of email notification sent." | rex field=source "/(?&lt;SOURCE_SHORT&gt;[^/]+)$" | table source TotalEmailsToSend TotalEmailsSent | dedup source&lt;/SOURCE_SHORT&gt;&lt;/TOTALEMAILSTOSEND&gt;&lt;/TOTALEMAILSSENT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:33:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98742#M25437</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T11:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98743#M25438</link>
      <description>&lt;P&gt;i tried renaming source_short to other things, didnt' work.  I tried making the regex | rex field=source "/opt/log/(?&lt;BLAHBLAH&gt;[^/]+)$" and that also didn't work.  I'm not the best at regex but I've got a handy chart here...still trying different things!&lt;/BLAHBLAH&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 15:31:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98743#M25438</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-03-22T15:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98744#M25439</link>
      <description>&lt;P&gt;Ok it did make a source_short field but the source listed isn't correct.  I will try again&lt;/P&gt;</description>
      <pubDate>Thu, 22 Mar 2012 16:06:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98744#M25439</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-03-22T16:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98745#M25440</link>
      <description>&lt;P&gt;The field listed was the last portion of the log path.  If the log path is /opt/log/dotinfo/eppcron/eppcron_balancememail.log, it listed as the source_short as only eppcron_balanceemail.log.  I should list dotinfo.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:33:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98745#M25440</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rename source in chart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98746#M25441</link>
      <description>&lt;P&gt;This worked!  sourcetype="cron_BalanceEmail" NOT host="&lt;EM&gt;.bmp2.&lt;/EM&gt;" earliest=-1d@d latest=-0d@d sent ([BalanceEmail] OR [null])   | rex field=_raw "\w+] ?(?&lt;TOTALEMAILSSENT&gt;[\d]+) of (?&lt;TOTALEMAILSTOSEND&gt;[\d]+) of email notification sent." | rex field=source "/(?&lt;SOURCE_SHORT&gt;[^/]+)/[^/]+/[^/]+$" | table source_short TotalEmailsToSend TotalEmailsSent | dedup source_short&lt;/SOURCE_SHORT&gt;&lt;/TOTALEMAILSTOSEND&gt;&lt;/TOTALEMAILSSENT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:33:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Rename-source-in-chart/m-p/98746#M25441</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2020-09-28T11:33:57Z</dc:date>
    </item>
  </channel>
</rss>

