<?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 modify the source field to match normal splunk file location in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269027#M51660</link>
    <description>&lt;P&gt;Try this in your Indexers and Heavy Forwarders and Search Heads (wherever you're collecting internal logs with this different path&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf 

[source::/san/splunk/var/log/splunk*]
TRANSFORMS-setsource = correct_source


transforms.conf

[correct_source]
SOURCE_KEY = MetaData:Source
DEST_KEY = MetaData:Source
REGEX = \/san\/splunk(\/var\/log\/splunk.*)
FORMAT = source::/opt/splunk$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 04 Feb 2016 20:41:59 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-02-04T20:41:59Z</dc:date>
    <item>
      <title>How to modify the source field to match normal splunk file location</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269024#M51657</link>
      <description>&lt;P&gt;We had to put the log files in  the /san/splunk/var/log/splunk directory vs the /opt/splunk/var/log/splunk directory. Of course, I can modify apps that have hard coded the path to files in that directory. Is there a way to use props or transform on the indexer with the awkward path so the source will show up as /opt/splunk/var/log/splunk on the search head? That way, I don't have to modify the search in apps needing to find files in the /san/splunk/var/log/splunk directory.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2016 10:42:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269024#M51657</guid>
      <dc:creator>coleman07</dc:creator>
      <dc:date>2016-02-04T10:42:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify the source field to match normal splunk file location</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269025#M51658</link>
      <description>&lt;P&gt;Change your search to look for */splunk/var/log...&lt;/P&gt;

&lt;P&gt;Or use sedcmd in props.conf on your sourcetype&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; sedcmd-santoopt = "s/\/san/\/opt/g"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use sed with the rex command in search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; ... | rex mode=sed "s/\/san/\/opt/g" | ...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 11:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269025#M51658</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-04T11:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify the source field to match normal splunk file location</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269026#M51659</link>
      <description>&lt;P&gt;You could hard code the source in your inputs.conf on your indexer or forwarder, &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.3.3/Admin/inputsconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.3.3/Admin/inputsconf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source= /opt/splunk/var/log/splunk/filename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 20:24:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269026#M51659</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2016-02-04T20:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify the source field to match normal splunk file location</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269027#M51660</link>
      <description>&lt;P&gt;Try this in your Indexers and Heavy Forwarders and Search Heads (wherever you're collecting internal logs with this different path&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf 

[source::/san/splunk/var/log/splunk*]
TRANSFORMS-setsource = correct_source


transforms.conf

[correct_source]
SOURCE_KEY = MetaData:Source
DEST_KEY = MetaData:Source
REGEX = \/san\/splunk(\/var\/log\/splunk.*)
FORMAT = source::/opt/splunk$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 Feb 2016 20:41:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269027#M51660</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-02-04T20:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to modify the source field to match normal splunk file location</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269028#M51661</link>
      <description>&lt;P&gt;I think that this regex would only match sources that began with the parent directory /san/ . Perhaps the regex could be relaxed to only match on the capture group:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [correct_source]
 SOURCE_KEY = MetaData:Source
 DEST_KEY = MetaData:Source
 REGEX = (\/var\/log\/splunk.*)
 FORMAT = source::$1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 07 Feb 2016 17:53:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-modify-the-source-field-to-match-normal-splunk-file/m-p/269028#M51661</guid>
      <dc:creator>landen99</dc:creator>
      <dc:date>2016-02-07T17:53:51Z</dc:date>
    </item>
  </channel>
</rss>

