<?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: Renaming sources for charting purposes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38382#M7065</link>
    <description>&lt;P&gt;You could use the rex command to rewrite the source field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=source "/(?&amp;lt;sourcefile&amp;gt;[^/]+?)$" | timechart count by sourcefile 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will transform a source that looks like "/opt/applocal/fs/dir/Log.log" to a field called sourcefile like "Log.log" &lt;/P&gt;</description>
    <pubDate>Fri, 27 Aug 2010 10:13:48 GMT</pubDate>
    <dc:creator>zscgeek</dc:creator>
    <dc:date>2010-08-27T10:13:48Z</dc:date>
    <item>
      <title>Renaming sources for charting purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38381#M7064</link>
      <description>&lt;P&gt;Hello, I have a chart that show event counts split by source name. For our analysis, it is very important that we see the source names. Because of the long path, the important part is .....&lt;/P&gt;

&lt;P&gt;e.g.&lt;/P&gt;

&lt;P&gt;/opt/applocal/fs/dir/Log.log&lt;/P&gt;

&lt;P&gt;shows as&lt;/P&gt;

&lt;P&gt;/opt/applocal......log&lt;/P&gt;

&lt;P&gt;Is there anything from Splunk Web I can do to improve the chart?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 08:58:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38381#M7064</guid>
      <dc:creator>ericrobinson</dc:creator>
      <dc:date>2010-08-27T08:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming sources for charting purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38382#M7065</link>
      <description>&lt;P&gt;You could use the rex command to rewrite the source field. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | rex field=source "/(?&amp;lt;sourcefile&amp;gt;[^/]+?)$" | timechart count by sourcefile 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That will transform a source that looks like "/opt/applocal/fs/dir/Log.log" to a field called sourcefile like "Log.log" &lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2010 10:13:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38382#M7065</guid>
      <dc:creator>zscgeek</dc:creator>
      <dc:date>2010-08-27T10:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Renaming sources for charting purposes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38383#M7066</link>
      <description>&lt;P&gt;The &lt;CODE&gt;replace&lt;/CODE&gt; search command is really helpful here too.  It's a little less flexible than the &lt;CODE&gt;rex&lt;/CODE&gt; approach, but it can also be much simpler to use.  (And there's no reason why you can't do both for different types of source names.)&lt;/P&gt;

&lt;P&gt;Here is an example I grabbed from one of my saved searches with source renaming:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | replace "*var*log*splunk*metrics.log*" with "splunk/metrics.log" "/stage/logs/*" with "/stage/logs/LOGFILE" "*var*log*splunk*splunkd.log*" with "splunk/splunkd.log" "/common/log/prefix/*.log" with "*.log" in source | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Aug 2010 21:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Renaming-sources-for-charting-purposes/m-p/38383#M7066</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-08-27T21:13:01Z</dc:date>
    </item>
  </channel>
</rss>

