<?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: universal forwarder manipulate host and source via inputs.conf in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470683#M80908</link>
    <description>&lt;P&gt;@vessev -&lt;/P&gt;

&lt;P&gt;That's probably a good decision.  In essence, if you wanted to do that, you could build a synthetic field in multiple steps, but you are leaving land mines for a later admin... who might very well be yourself.&lt;/P&gt;

&lt;P&gt;More importantly, overriding the "source" is not perhaps the best strategy. &lt;/P&gt;

&lt;P&gt;Consider adding another index-time field that contains what you want:  a tag, or another named field, or whatever.   Think about the overhead, and make your best guess.  &lt;/P&gt;

&lt;P&gt;If you only added it to the ones that you wanted to change, the overhead cost might be limited.&lt;/P&gt;

&lt;P&gt;Best wishes.&lt;/P&gt;</description>
    <pubDate>Thu, 23 Apr 2020 22:06:28 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2020-04-23T22:06:28Z</dc:date>
    <item>
      <title>universal forwarder manipulate host and source via inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470680#M80905</link>
      <description>&lt;P&gt;I have a dedicated server which is running syslog-ng and a universal forwarder.&lt;/P&gt;

&lt;P&gt;i want to set 3 things one of them dynamically:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;# /opt/splunkforwarder/etc/system/local/inputs.conf
[monitor:///data/syslog-ng/logs/u514/cisco/ios/*/*.log]
sourcetype = syslog
source = syslog-ng:udp514
host_segment = 7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem is that i cannot set source and host_segment (or host_regex) at the same time.&lt;BR /&gt;
Because the host_segment uses (why ever on earth i don't know) the source string.&lt;BR /&gt;
Host segment defines the "7" position as the host variable. &lt;BR /&gt;
So if i define the source by myselft host_segment will fail. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Is it possibile to have a manually created source field and a dynamically generated host field?&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I could do this by creating a new props.conf and transforms.conf to manipulate the source segment. But i do not want this to be generally done... There are a few logs for which i do not want that. &lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 04:55:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470680#M80905</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2020-09-30T04:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: universal forwarder manipulate host and source via inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470681#M80906</link>
      <description>&lt;P&gt;In the case of a monitor stanza, the source, by definition, is the name of the file it came from.&lt;/P&gt;

&lt;P&gt;If changing the order of those lines in the monitor stanza doesn't work, then move the alteration of the source to a transforms stanza and use a regex to identify which ones do or do not qualify to become the new source.&lt;/P&gt;

&lt;P&gt;That would look something like this.  (Try this in a sandbox first, because it's all air code.): &lt;/P&gt;

&lt;P&gt;in inputs.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///data/syslog-ng/logs/u514/cisco/ios/*/*.log]
 sourcetype = syslog
 host_segment = 7
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [syslog]
 transforms-newsource1 = somestanza
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[somestanza]
SOURCE_KEY = however you are deciding which ones to change 
REGEX = however you are deciding which ones to change 
DEST_KEY = MetaData:Source 
FORMAT = source::syslog-ng:udp514
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can do really tricky stuff, but you have to do it in the exact right order.  Here's an old example.&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/511972/regex-to-match-two-fields-in-transformsconf.html"&gt;https://answers.splunk.com/answers/511972/regex-to-match-two-fields-in-transformsconf.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Apr 2020 21:13:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470681#M80906</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-04-10T21:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: universal forwarder manipulate host and source via inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470682#M80907</link>
      <description>&lt;P&gt;I thought about your idea before and this could work if there wouldn't be a problem with all other stuff which has the sourcetype [syslog]. &lt;BR /&gt;
As far as i know there is no possibility to divide INPUT Data in props.conf by two keys - sourcetype match AND host match. The only possibility would be to use the source in props.conf and manipulate via transform.conf.&lt;BR /&gt;
If i want to use the source i have to specify all relevant information in the file path. For example:&lt;BR /&gt;
/data/syslog/&lt;STRONG&gt;syslog-ng&lt;/STRONG&gt;/&lt;STRONG&gt;u514&lt;/STRONG&gt;/cisco/ios/ciscoswitch/20200417-cisco-ios.log and the take the information out of it that i want.&lt;BR /&gt;
After thinking about those possibilities i decided to let go of this requirement.&lt;BR /&gt;
I changed the folder path to include all important information and live with the fact that there is no easy solution for that. To manipulate 3 confs to achive this goal could backfire in a year or two.&lt;/P&gt;

&lt;P&gt;Thanks for your suggestion - i check it as answer cause it is for all what i know the only possibilty to achive this. BR Michele&lt;/P&gt;</description>
      <pubDate>Fri, 17 Apr 2020 14:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470682#M80907</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2020-04-17T14:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: universal forwarder manipulate host and source via inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470683#M80908</link>
      <description>&lt;P&gt;@vessev -&lt;/P&gt;

&lt;P&gt;That's probably a good decision.  In essence, if you wanted to do that, you could build a synthetic field in multiple steps, but you are leaving land mines for a later admin... who might very well be yourself.&lt;/P&gt;

&lt;P&gt;More importantly, overriding the "source" is not perhaps the best strategy. &lt;/P&gt;

&lt;P&gt;Consider adding another index-time field that contains what you want:  a tag, or another named field, or whatever.   Think about the overhead, and make your best guess.  &lt;/P&gt;

&lt;P&gt;If you only added it to the ones that you wanted to change, the overhead cost might be limited.&lt;/P&gt;

&lt;P&gt;Best wishes.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Apr 2020 22:06:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470683#M80908</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2020-04-23T22:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: universal forwarder manipulate host and source via inputs.conf</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470684#M80909</link>
      <description>&lt;P&gt;Thats a good idea thank you for that suggestion.&lt;/P&gt;

&lt;P&gt;BR Michele&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 11:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/universal-forwarder-manipulate-host-and-source-via-inputs-conf/m-p/470684#M80909</guid>
      <dc:creator>vessev</dc:creator>
      <dc:date>2020-04-27T11:39:00Z</dc:date>
    </item>
  </channel>
</rss>

