<?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 configure setting the host field during index time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248562#M74221</link>
    <description>&lt;P&gt;Did remove the underscore ( _ ) long ago, but did not help. I have changed a few things this morning and finally got it working now.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Changed the Regex&lt;/LI&gt;
&lt;LI&gt;Have to specify the transforms for all the different sourcetypes,  add only a single stanza doesn't work. Tested it by adding single stanza (did not work) and then changed and added it for every sourcetype .&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;[hostextract]&lt;BR /&gt;
 REGEX = (ep\w*\d)&lt;BR /&gt;
 FORMAT = host::$1&lt;BR /&gt;
 DEST_KEY = MetaData:Host&lt;/P&gt;

&lt;P&gt;[sm-plat]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-expt]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-impt]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-vend]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 30 Jan 2017 18:38:35 GMT</pubDate>
    <dc:creator>nmohammed</dc:creator>
    <dc:date>2017-01-30T18:38:35Z</dc:date>
    <item>
      <title>How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248557#M74216</link>
      <description>&lt;P&gt;we're trying to set the host fields by extracting the name from the events, but it doesn't seem to work and would appreciate if someone can guide through - &lt;/P&gt;

&lt;P&gt;example events - &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2017-01-20 14:18:55,816 [31] ep7mmn001 ERROR SMS.Shared.ApiCommon.Attribute.smapiAuthorizeAttribute    at System.Convert.FromBase64_Decode(Char* startInputPtr, Int32 inputLength, Byte* startDestPtr, Int32 destLength)
   at System.Convert.FromBase64CharPtr(Char* inputPtr, Int32 inputLength)
   at System.Convert.FromBase64CharArray(Char[] inArray, Int32 offset, Int32 length)
   at Newtonsoft.Json.JsonTextReader.ParseString(Char quote)
   at Newtonsoft.Json.JsonTextReader.ParseValue()
2017-01-20 14:18:55,816 [31] ep8mmn002 ERROR SMS.Shared.ApiCommon.Attribute.smApiAuthorizeAttribute Invalid length for a Base-64 char array or string.
2017-01-20 14:18:55,816 [31] ep8mmn006 ERROR SMS.Shared.ApiCommon.Attribute.smApiAuthorizeAttribute Invalid length for a Base-64 char array or string.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;props.conf &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[sm-plat]
TRANSFORMS-hostextract=hostextract

[sm-expt]
TRANSFORMS-hostextract=hostextract

[sm-impt]
TRANSFORMS-hostextract=hostextract

[sm-vend]
TRANSFORMS-hostextract=hostextract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[hostextract]
REGEX = ^[^\]\n]*\]\s+(\w+)
FORMAT = host::$1
DEST_KEY = _MetaData:Host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jan 2017 23:02:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248557#M74216</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2017-01-20T23:02:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248558#M74217</link>
      <description>&lt;P&gt;Hi nmohammed,&lt;/P&gt;

&lt;P&gt;Since you are just using one transform stanza, I think you can just use one stanza to reference it in props.conf: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; [sm]
 TRANSFORMS-hostextract=hostextract
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Also, the REGEX does not seem quite right and I'm not sure which hostnames it tries to capture from the events. You may need to finetune the REGEX to make sure it extracts hostnames correctly. &lt;/P&gt;

&lt;P&gt;Hope it helps. Thanks!&lt;BR /&gt;
Hunter&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2017 01:10:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248558#M74217</guid>
      <dc:creator>hunters_splunk</dc:creator>
      <dc:date>2017-01-21T01:10:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248559#M74218</link>
      <description>&lt;P&gt;First of all, your regex is OK - I saw that on my own, but regex101.com confirmed it as well. So the problem is in either your stanza in &lt;CODE&gt;transforms.conf&lt;/CODE&gt; - but it seems OK to me again - or in your referencing the transform from &lt;CODE&gt;props.conf&lt;/CODE&gt;. Do your events end up in one of those sourcetypes (sm-plat, sm-expt, sm-impt, sm-vend) and how do you specify their sourcetype?&lt;/P&gt;</description>
      <pubDate>Sat, 21 Jan 2017 02:06:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248559#M74218</guid>
      <dc:creator>arkadyz1</dc:creator>
      <dc:date>2017-01-21T02:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248560#M74219</link>
      <description>&lt;P&gt;Thanks. I tried hunters approach and referenced only one stanza ,but still doesn't work.&lt;/P&gt;

&lt;P&gt;[sm]&lt;BR /&gt;
TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;arkadzy1 -&lt;/P&gt;

&lt;P&gt;we are assigning sourcetypes based on the respective sources -&lt;/P&gt;

&lt;P&gt;inputs.conf&lt;/P&gt;

&lt;P&gt;[monitor:\\share\sm\sm-expt]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
whitelist = .txt$|.log$&lt;BR /&gt;
index = sm&lt;BR /&gt;
sourcetype = sm-expt&lt;/P&gt;

&lt;P&gt;[monitor:\\share\sm\sm-impt]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
whitelist = .txt$|.log$&lt;BR /&gt;
index = sm&lt;BR /&gt;
sourcetype = sm-impt&lt;/P&gt;

&lt;P&gt;[monitor:\\share\sm\sm-plat]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
whitelist = .txt$|.log$&lt;BR /&gt;
index = sm&lt;BR /&gt;
sourcetype = sm-plat&lt;/P&gt;

&lt;P&gt;[monitor:\\share\sm\sm-vend]&lt;BR /&gt;
disabled = false&lt;BR /&gt;
whitelist = .txt$|.log$&lt;BR /&gt;
index = sm&lt;BR /&gt;
sourcetype = sm-vend&lt;/P&gt;

&lt;P&gt;Not really sure , where we're going wrong. The regex looks fine when tested and the logs are using log4net type of logging format. we have just assigned different sourcetypes for ease in identifying different applications. &lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2017 22:07:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248560#M74219</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2017-01-23T22:07:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248561#M74220</link>
      <description>&lt;P&gt;One of the things I just realized: in &lt;CODE&gt;transforms.conf&lt;/CODE&gt;, you have an underscore ( &lt;CODE&gt;_&lt;/CODE&gt;) before &lt;CODE&gt;MetaData&lt;/CODE&gt;, which, I believe, should not be there. Try &lt;CODE&gt;DEST_KEY = MetaData:Host&lt;/CODE&gt; and see.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 16:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248561#M74220</guid>
      <dc:creator>arkadyz1</dc:creator>
      <dc:date>2017-01-27T16:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to configure setting the host field during index time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248562#M74221</link>
      <description>&lt;P&gt;Did remove the underscore ( _ ) long ago, but did not help. I have changed a few things this morning and finally got it working now.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Changed the Regex&lt;/LI&gt;
&lt;LI&gt;Have to specify the transforms for all the different sourcetypes,  add only a single stanza doesn't work. Tested it by adding single stanza (did not work) and then changed and added it for every sourcetype .&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;[hostextract]&lt;BR /&gt;
 REGEX = (ep\w*\d)&lt;BR /&gt;
 FORMAT = host::$1&lt;BR /&gt;
 DEST_KEY = MetaData:Host&lt;/P&gt;

&lt;P&gt;[sm-plat]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-expt]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-impt]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;[sm-vend]&lt;BR /&gt;
 TRANSFORMS-hostextract=hostextract&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2017 18:38:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-configure-setting-the-host-field-during-index-time/m-p/248562#M74221</guid>
      <dc:creator>nmohammed</dc:creator>
      <dc:date>2017-01-30T18:38:35Z</dc:date>
    </item>
  </channel>
</rss>

