<?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: Can I Assign to Host The Value From A Variable? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82470#M17077</link>
    <description>&lt;P&gt;basically doing the above and then use a index time extraction. Ok thanks&lt;/P&gt;</description>
    <pubDate>Wed, 03 Nov 2010 07:01:39 GMT</pubDate>
    <dc:creator>attoriozi</dc:creator>
    <dc:date>2010-11-03T07:01:39Z</dc:date>
    <item>
      <title>Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82467#M17074</link>
      <description>&lt;P&gt;I would like to assign to "host" a variable initiated in the input script.&lt;/P&gt;

&lt;P&gt;For instance, is it possible something like this:&lt;/P&gt;

&lt;P&gt;[script://./bin/hostrandom.sh] &lt;/P&gt;&lt;P&gt;
interval = 10 &lt;/P&gt;&lt;P&gt;
host = $RHOST &lt;/P&gt;&lt;P&gt;
sourcetype = hostrandom &lt;/P&gt;&lt;P&gt; 
disabled = 0 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;where &lt;/P&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;cat ../bin/hostrandom.sh &lt;/P&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;export RHOST=HOST$RANDOM &lt;/P&gt;&lt;P&gt;
echo "This is the Event for $RHOST " &lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2010 06:02:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82467#M17074</guid>
      <dc:creator>attoriozi</dc:creator>
      <dc:date>2010-11-03T06:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82468#M17075</link>
      <description>&lt;P&gt;You can't do this based on a value that is set in the scripted input, though you can use a variable that is set in the environment in which the Splunk process runs. However, if you have a scripted input, there are other ways to set the host by having the script itself output a field that can be transformed at index time, or by using &lt;A href="http://www.splunk.com/base/Documentation/latest/Admin/Assignmetadatatoeventsdynamically" rel="nofollow"&gt;dynamic metadata assignment&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2010 06:27:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82468#M17075</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-11-03T06:27:20Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82469#M17076</link>
      <description>&lt;P&gt;Documentation is not very clear. I think it just suggests a script like: &amp;lt;&amp;lt; echo "This is the Event for host=RHOST$RANDOM " &amp;gt;&amp;gt;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2010 06:45:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82469#M17076</guid>
      <dc:creator>attoriozi</dc:creator>
      <dc:date>2010-11-03T06:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82470#M17077</link>
      <description>&lt;P&gt;basically doing the above and then use a index time extraction. Ok thanks&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2010 07:01:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82470#M17077</guid>
      <dc:creator>attoriozi</dc:creator>
      <dc:date>2010-11-03T07:01:39Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82471#M17078</link>
      <description>&lt;P&gt;still not good: in my case the input script generates an event that needs to be split in multiple events (SHOULD_LINEMERGE=true). In this case only one of those events is going to be associated to the extracted host, all the other are going to be associated to default host.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Nov 2010 07:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82471#M17078</guid>
      <dc:creator>attoriozi</dc:creator>
      <dc:date>2010-11-03T07:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: Can I Assign to Host The Value From A Variable?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82472#M17079</link>
      <description>&lt;P&gt;Don't use should_linemerge = true. Use SHOULD_LINEMERGE = false and a unique LINE_BREAKER pattern between events.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 09:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-I-Assign-to-Host-The-Value-From-A-Variable/m-p/82472#M17079</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2020-09-28T09:20:18Z</dc:date>
    </item>
  </channel>
</rss>

