<?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 you expose an env variable as a field in events coming from that forwarder in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329867#M98205</link>
    <description>&lt;P&gt;I had considered doing it this way too but did not know about the AWS add-on and was unsure of how to keep the csv up current. Thanks!!!&lt;/P&gt;</description>
    <pubDate>Fri, 14 Apr 2017 18:47:34 GMT</pubDate>
    <dc:creator>stath002</dc:creator>
    <dc:date>2017-04-14T18:47:34Z</dc:date>
    <item>
      <title>Can you expose an env variable as a field in events coming from that forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329865#M98203</link>
      <description>&lt;P&gt;I am trying to expose an environment variable and make it a field for events coming from a splunk universal forwarder. &lt;/P&gt;

&lt;P&gt;We are trying to get Amazon stack name as field that can be searched for in events. It is not currently logged but it is available as a env variable. Is there a way to easily add this env variable to events that are coming from AWS hosts via a universal forwarder? We want to be able to search: &lt;CODE&gt;index=some_index sourcetype=all_sourcetypes_for_this_index &amp;lt;some env_var&amp;gt;=foo&lt;/CODE&gt; where &lt;CODE&gt;&amp;lt;some_env_var&amp;gt;=foo&lt;/CODE&gt; is coming from the linux system variable&lt;/P&gt;

&lt;P&gt;I looked at doing an indexed field extraction but it still looks like that needs to come from a log file. If not I am not seeing how to basically index a field at index time using the env variable. &lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 00:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329865#M98203</guid>
      <dc:creator>stath002</dc:creator>
      <dc:date>2017-04-14T00:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: Can you expose an env variable as a field in events coming from that forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329866#M98204</link>
      <description>&lt;P&gt;You'd have to do a transforms to rewrite the raw data BUT I strongly recommend against that. There are so many reasons not to muck with the data itself.&lt;/P&gt;

&lt;P&gt;Instead, I'd recommend using an &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/DefineanautomaticlookupinSplunkWeb"&gt;automatic lookup&lt;/A&gt;. The result sounds the same: anytime you search on that host, splunk will add a field (not in the raw, but in the field list) of the stack name you want. You'd likely want to use the &lt;A href="https://splunkbase.splunk.com/app/1876/"&gt;AWS Add On&lt;/A&gt; to easily fetch those stack names and then simply push those details into a csv periodically (scheduled search with &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Outputlookup"&gt;outputlookup&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 13:12:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329866#M98204</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2017-04-14T13:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can you expose an env variable as a field in events coming from that forwarder</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329867#M98205</link>
      <description>&lt;P&gt;I had considered doing it this way too but did not know about the AWS add-on and was unsure of how to keep the csv up current. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Fri, 14 Apr 2017 18:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Can-you-expose-an-env-variable-as-a-field-in-events-coming-from/m-p/329867#M98205</guid>
      <dc:creator>stath002</dc:creator>
      <dc:date>2017-04-14T18:47:34Z</dc:date>
    </item>
  </channel>
</rss>

