<?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 Question about host field in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Question-about-host-field/m-p/575421#M101718</link>
    <description>&lt;P&gt;I'm trying to put a host in a host field before indexing the csv file below.&lt;/P&gt;&lt;P&gt;【CSV file】&lt;/P&gt;&lt;P class="lia-align-left lia-indent-padding-left-30px"&gt;#ServerName001&lt;BR /&gt;#JobName,Start time,End time,Elapsed time,Status&lt;BR /&gt;JobName_01,11/05/21 19:08:07,11/05/21 19:08:41,00:00:34,Succeeded&lt;BR /&gt;JobName_02,11/05/21 20:49:53,11/05/21 21:19:06,00:29:13,Succeeded&lt;BR /&gt;JobName_03,11/05/21 21:53:10,11/05/21 21:53:15,00:00:05,Succeeded&lt;/P&gt;&lt;P&gt;I set TRANSFORMS in props.conf with changeHost and set the contents of changeHost in transfoms.conf as follows.&lt;/P&gt;&lt;P&gt;【changeHost】&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;[changeHost]&lt;BR /&gt;SOURCE_KEY = _raw&lt;BR /&gt;REGEX = \#(\S+)\s\#:&lt;BR /&gt;DEST_KEY = MetaData:Host&lt;BR /&gt;FORMAT = host::$1&lt;/P&gt;&lt;P&gt;I want to set host field as ServerName001, but it doesn't work.&lt;BR /&gt;Can anyone give me some advice?&lt;/P&gt;</description>
    <pubDate>Thu, 18 Nov 2021 10:57:44 GMT</pubDate>
    <dc:creator>AHA-0114</dc:creator>
    <dc:date>2021-11-18T10:57:44Z</dc:date>
    <item>
      <title>Question about host field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Question-about-host-field/m-p/575421#M101718</link>
      <description>&lt;P&gt;I'm trying to put a host in a host field before indexing the csv file below.&lt;/P&gt;&lt;P&gt;【CSV file】&lt;/P&gt;&lt;P class="lia-align-left lia-indent-padding-left-30px"&gt;#ServerName001&lt;BR /&gt;#JobName,Start time,End time,Elapsed time,Status&lt;BR /&gt;JobName_01,11/05/21 19:08:07,11/05/21 19:08:41,00:00:34,Succeeded&lt;BR /&gt;JobName_02,11/05/21 20:49:53,11/05/21 21:19:06,00:29:13,Succeeded&lt;BR /&gt;JobName_03,11/05/21 21:53:10,11/05/21 21:53:15,00:00:05,Succeeded&lt;/P&gt;&lt;P&gt;I set TRANSFORMS in props.conf with changeHost and set the contents of changeHost in transfoms.conf as follows.&lt;/P&gt;&lt;P&gt;【changeHost】&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;[changeHost]&lt;BR /&gt;SOURCE_KEY = _raw&lt;BR /&gt;REGEX = \#(\S+)\s\#:&lt;BR /&gt;DEST_KEY = MetaData:Host&lt;BR /&gt;FORMAT = host::$1&lt;/P&gt;&lt;P&gt;I want to set host field as ServerName001, but it doesn't work.&lt;BR /&gt;Can anyone give me some advice?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 10:57:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Question-about-host-field/m-p/575421#M101718</guid>
      <dc:creator>AHA-0114</dc:creator>
      <dc:date>2021-11-18T10:57:44Z</dc:date>
    </item>
    <item>
      <title>Re: Question about host field</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Question-about-host-field/m-p/575452#M101721</link>
      <description>&lt;P&gt;Depending on what other settings are in props.conf, it's possible the # lines are ignored.&lt;/P&gt;&lt;P&gt;Even so, however, each line of the CSV file is processed independently with the transform attempting to find "#".&amp;nbsp; When it fails to find a match (because there is no "#" on the line) the host name is not written&lt;/P&gt;&lt;P&gt;I'm not aware of a method to extract a field and then use it in every event that follows.&amp;nbsp; Perhaps you coudl suggest it at&amp;nbsp;&lt;A href="https://ideas.splunk.com" target="_blank"&gt;https://ideas.splunk.com&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Nov 2021 14:30:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Question-about-host-field/m-p/575452#M101721</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-11-18T14:30:00Z</dc:date>
    </item>
  </channel>
</rss>

