<?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 How to replace meta information? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98452#M20569</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a small lab where there is a &lt;CODE&gt;heavy forwarder&lt;/CODE&gt;. I can/want to perform transformation on Meta info at Heavy forwarder level. I have two related questions.&lt;/P&gt;

&lt;P&gt;The first question --&lt;/P&gt;

&lt;P&gt;I have a &lt;CODE&gt;source&lt;/CODE&gt; field something like -- &lt;CODE&gt;/&amp;lt;dir1&amp;gt;/&amp;lt;dir2&amp;gt;/&amp;lt;logfilename&amp;gt;&lt;/CODE&gt; and I want to remove &lt;CODE&gt;/&amp;lt;dir1&amp;gt;/&amp;lt;dir2&amp;gt;&lt;/CODE&gt; from source field. How can I do that?&lt;/P&gt;

&lt;P&gt;I also want to rewrite &lt;CODE&gt;sourcetype&lt;/CODE&gt; field before sending data to indexer. Let's say if we find &lt;CODE&gt;secure&lt;/CODE&gt; in any part of &lt;CODE&gt;sourcetype&lt;/CODE&gt; then &lt;CODE&gt;sourcetype&lt;/CODE&gt; should be &lt;CODE&gt;secure&lt;/CODE&gt;. (i.e. remove all other characters except &lt;CODE&gt;secure&lt;/CODE&gt; )&lt;/P&gt;

&lt;P&gt;Please help!&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Wed, 26 Oct 2011 14:52:57 GMT</pubDate>
    <dc:creator>rahiparikh</dc:creator>
    <dc:date>2011-10-26T14:52:57Z</dc:date>
    <item>
      <title>How to replace meta information?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98452#M20569</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a small lab where there is a &lt;CODE&gt;heavy forwarder&lt;/CODE&gt;. I can/want to perform transformation on Meta info at Heavy forwarder level. I have two related questions.&lt;/P&gt;

&lt;P&gt;The first question --&lt;/P&gt;

&lt;P&gt;I have a &lt;CODE&gt;source&lt;/CODE&gt; field something like -- &lt;CODE&gt;/&amp;lt;dir1&amp;gt;/&amp;lt;dir2&amp;gt;/&amp;lt;logfilename&amp;gt;&lt;/CODE&gt; and I want to remove &lt;CODE&gt;/&amp;lt;dir1&amp;gt;/&amp;lt;dir2&amp;gt;&lt;/CODE&gt; from source field. How can I do that?&lt;/P&gt;

&lt;P&gt;I also want to rewrite &lt;CODE&gt;sourcetype&lt;/CODE&gt; field before sending data to indexer. Let's say if we find &lt;CODE&gt;secure&lt;/CODE&gt; in any part of &lt;CODE&gt;sourcetype&lt;/CODE&gt; then &lt;CODE&gt;sourcetype&lt;/CODE&gt; should be &lt;CODE&gt;secure&lt;/CODE&gt;. (i.e. remove all other characters except &lt;CODE&gt;secure&lt;/CODE&gt; )&lt;/P&gt;

&lt;P&gt;Please help!&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 14:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98452#M20569</guid>
      <dc:creator>rahiparikh</dc:creator>
      <dc:date>2011-10-26T14:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace meta information?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98453#M20570</link>
      <description>&lt;P&gt;You can try rewriting (reformating) the source key for your first question. You can use transforms and props to do that. Here's an example of how transforms.conf may look like:&lt;/P&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[&amp;lt;unique_transform_stanza_name&amp;gt;]&lt;BR /&gt;
SOURCE_KEY = MetaData:Source &lt;BR /&gt;
REGEX = &amp;lt;regular_expression&amp;gt;&lt;BR /&gt;
FORMAT = source::$1&lt;BR /&gt;
DEST_KEY = MetaData:Source&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;props.conf&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;[&amp;lt;spec&amp;gt;]&lt;BR /&gt;
TRANSFORMS-&amp;lt;value&amp;gt; = &amp;lt;unique_stanza_name&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For your second question you can do pretty much the same thing, but operate on MetaData:Sourcetype instead of Source.&lt;/P&gt;

&lt;P&gt;There is additional and very helpful information here:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.4/Admin/Transformsconf"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.4/Admin/Transformsconf&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.2.4/Data/Configureindex-timefieldextraction"&gt;http://docs.splunk.com/Documentation/Splunk/4.2.4/Data/Configureindex-timefieldextraction&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;- please upvote if you find this answer useful&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 15:10:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98453#M20570</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2011-10-26T15:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace meta information?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98454#M20571</link>
      <description>&lt;P&gt;Thanks for reply! This works. I have already tried this. But problem with it is -- &lt;DIR2&gt; is a device name. I use host_segment to extract device name. Now, when I use both together, the host_segment will not have effect! &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/DIR2&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 10:01:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98454#M20571</guid>
      <dc:creator>rahiparikh</dc:creator>
      <dc:date>2020-09-28T10:01:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace meta information?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98455#M20572</link>
      <description>&lt;P&gt;In that case then i would try using &lt;CODE&gt;priority=n&lt;/CODE&gt; in the affected props stanzas. More on priority or precedence can be found here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Admin/Propsconf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 15:28:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98455#M20572</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2011-10-26T15:28:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace meta information?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98456#M20573</link>
      <description>&lt;P&gt;Will this work? I want to perform transformation on Heavy Forwarder and send data to indexer. I do not index locally.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Oct 2011 15:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-replace-meta-information/m-p/98456#M20573</guid>
      <dc:creator>rahiparikh</dc:creator>
      <dc:date>2011-10-26T15:38:57Z</dc:date>
    </item>
  </channel>
</rss>

