<?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 create a custom field with values based on the monitors in inputs.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183162#M52740</link>
    <description>&lt;P&gt;You can include &lt;CODE&gt;index=foo&lt;/CODE&gt; in your inputs.conf file, but not props.conf.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Aug 2015 12:43:06 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2015-08-24T12:43:06Z</dc:date>
    <item>
      <title>How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183157#M52735</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;In my inputs.conf I have a number of monitors. I would like to create a custom field called logtypevalue with values based of the monitors. For example, if the monitor is:&lt;/P&gt;

&lt;P&gt;[monitor://D:\logs\logfiles\tomcat*.log]&lt;/P&gt;

&lt;P&gt;I want the value of logtypevalue set to abcde.&lt;/P&gt;

&lt;P&gt;If the monitor is:&lt;/P&gt;

&lt;P&gt;[monitor://D:\logs\logfiles\apache*.log]&lt;/P&gt;

&lt;P&gt;I want the value of logtypevalue set to testing.&lt;/P&gt;

&lt;P&gt;Basically the values of logtypevalue can't be extracted from the monitor so I am not sure how I can do this.&lt;/P&gt;

&lt;P&gt;Any help will be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;Jackie&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 16:39:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183157#M52735</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2015-08-21T16:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183158#M52736</link>
      <description>&lt;P&gt;I don't know you can do that in inputs.conf, but it's possible in props.conf.  In the appropriate stanza for each input's sourcetype add&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-logtypevalue = "abcde"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EVAL-logtypevalue = "testing"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Aug 2015 17:21:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183158#M52736</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-21T17:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183159#M52737</link>
      <description>&lt;P&gt;You can hard-code each &lt;CODE&gt;monitor&lt;/CODE&gt; inside &lt;CODE&gt;inputs.conf&lt;/CODE&gt; with a unique sourcetype such as &lt;CODE&gt;STunique1&lt;/CODE&gt;, &lt;CODE&gt;STunique2&lt;/CODE&gt;, etc.&lt;BR /&gt;
Then inside &lt;CODE&gt;props.conf&lt;/CODE&gt; you do like @richgalloway said and use &lt;CODE&gt;EVAL-logtypevalue="testing"&lt;/CODE&gt; or whatever, for each unique &lt;CODE&gt;sourcetype&lt;/CODE&gt; but you also rename the sourcetype here with &lt;CODE&gt;rename = "STcommon"&lt;/CODE&gt; so that in the end, each one goes back to sharing the same sourcetype but with unique values for &lt;CODE&gt;logtypevalue&lt;/CODE&gt;!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Aug 2015 23:19:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183159#M52737</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-21T23:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183160#M52738</link>
      <description>&lt;P&gt;Thanks a lot. I managed to do it based on your suggestion.&lt;/P&gt;

&lt;P&gt;In props.conf, I have this setting:&lt;/P&gt;

&lt;P&gt;[source::D:\\abc\\testing*.log]&lt;BR /&gt;
EVAL-log_type = "testing-logs"&lt;/P&gt;

&lt;P&gt;[source::D:\\def\\reporting*.log]&lt;BR /&gt;
EVAL-log_type = "reporting-logs"&lt;/P&gt;

&lt;P&gt;Now my question is that is it possible to specify the index in the above settings as well?&lt;/P&gt;

&lt;P&gt;It may happen that logs with the same paths coming from different servers for different indexes will match the paths above. I only want those that match the paths above and for a particular index to have log_type configured.&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:36:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183160#M52738</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2015-08-24T12:36:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183161#M52739</link>
      <description>&lt;P&gt;Thanks a lot. I managed to do it based on your suggestion.&lt;/P&gt;

&lt;P&gt;In props.conf, I have this setting:&lt;/P&gt;

&lt;P&gt;[source::D:\abc\testing*.log]&lt;BR /&gt;
EVAL-log_type = "testing-logs"&lt;/P&gt;

&lt;P&gt;[source::D:\def\reporting*.log]&lt;BR /&gt;
EVAL-log_type = "reporting-logs"&lt;/P&gt;

&lt;P&gt;Now my question is that is it possible to specify the index in the above settings as well?&lt;/P&gt;

&lt;P&gt;It may happen that logs with the same paths coming from different servers for different indexes will match the paths above. I only want those that match the paths above and for a particular index to have log_type configured.&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:40:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183161#M52739</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2015-08-24T12:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183162#M52740</link>
      <description>&lt;P&gt;You can include &lt;CODE&gt;index=foo&lt;/CODE&gt; in your inputs.conf file, but not props.conf.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 12:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183162#M52740</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2015-08-24T12:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183163#M52741</link>
      <description>&lt;P&gt;See my alternative answer.  It will allow you to take into effect the &lt;CODE&gt;index&lt;/CODE&gt; value by doing this based on &lt;CODE&gt;sourcetype&lt;/CODE&gt; rather than by &lt;CODE&gt;source&lt;/CODE&gt; (eliminating your problem entirely).&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 17:12:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183163#M52741</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-24T17:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183164#M52742</link>
      <description>&lt;P&gt;Thanks for the reply, but the problem we have is that we use sourcetype for something else (linebreak). Therefore in our inputs.conf, there are multiple monitors with the same sourcetype which can't be changed. This means the only thing we can use to distinguish between different sources (i.e. monitors) is the source itself.&lt;/P&gt;

&lt;P&gt;Now I have updated props.conf with the settings in my reply above, and it works fine. There should not be another monitor with the exact same path but for a different index cos that would not be right, but I am just thinking out loud here whether it is possible to include the index in the configs above. Something like if the source is D:\def\reporting*.log and it is for the index "abc" then do the EVAL-log_type part.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 08:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183164#M52742</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2015-08-25T08:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183165#M52743</link>
      <description>&lt;P&gt;Not possible.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 13:56:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183165#M52743</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-25T13:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to create a custom field with values based on the monitors in inputs.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183166#M52744</link>
      <description>&lt;P&gt;ok, thanks for getting back to me.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Aug 2015 14:57:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-custom-field-with-values-based-on-the-monitors/m-p/183166#M52744</guid>
      <dc:creator>jackiewkc</dc:creator>
      <dc:date>2015-08-25T14:57:14Z</dc:date>
    </item>
  </channel>
</rss>

