<?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 Log field to Splunk using HEC appender in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Log-field-to-Splunk-using-HEC-appender/m-p/480683#M100218</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to log a field, in this case the app version of an application to splunk. The application runs in cloud foundry. The app version is available as an env variable.&lt;BR /&gt;
I am using the HttpEventCollectorLogbackAppender (HECLogbackAppender)&lt;/P&gt;

&lt;P&gt;First try: When I extend the &lt;CODE&gt;HttpEventCollectorLogbackAppender&lt;/CODE&gt; class and add a variable appVersion, just like the other fields &lt;CODE&gt;sourcetype&lt;/CODE&gt;, &lt;CODE&gt;source&lt;/CODE&gt;, and so on, that doesn't work, it's not inside the json that's being sent to Splunk.&lt;/P&gt;

&lt;P&gt;Second try: When I add the &lt;CODE&gt;app_version&lt;/CODE&gt; with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MDC.put("app_version", my_app_version_from_env_var) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(google for "logback MDC" for more information on MDC)&lt;BR /&gt;
the &lt;CODE&gt;app_version&lt;/CODE&gt; gets logged in the &lt;CODE&gt;properties&lt;/CODE&gt; field of the json when the app starts, so all the Spring-related stuff that gets logged when a Spring application starts, contains &lt;CODE&gt;"properties":{"app_version":"1.13"}&lt;/CODE&gt; in the json.&lt;BR /&gt;
But after a few logs, the properties field does not appear anymore, and so doesn't the &lt;CODE&gt;app_version&lt;/CODE&gt;.&lt;BR /&gt;
Can someone help?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Fri, 13 Sep 2019 13:19:58 GMT</pubDate>
    <dc:creator>dlarah</dc:creator>
    <dc:date>2019-09-13T13:19:58Z</dc:date>
    <item>
      <title>Log field to Splunk using HEC appender</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Log-field-to-Splunk-using-HEC-appender/m-p/480683#M100218</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I want to log a field, in this case the app version of an application to splunk. The application runs in cloud foundry. The app version is available as an env variable.&lt;BR /&gt;
I am using the HttpEventCollectorLogbackAppender (HECLogbackAppender)&lt;/P&gt;

&lt;P&gt;First try: When I extend the &lt;CODE&gt;HttpEventCollectorLogbackAppender&lt;/CODE&gt; class and add a variable appVersion, just like the other fields &lt;CODE&gt;sourcetype&lt;/CODE&gt;, &lt;CODE&gt;source&lt;/CODE&gt;, and so on, that doesn't work, it's not inside the json that's being sent to Splunk.&lt;/P&gt;

&lt;P&gt;Second try: When I add the &lt;CODE&gt;app_version&lt;/CODE&gt; with &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;MDC.put("app_version", my_app_version_from_env_var) 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(google for "logback MDC" for more information on MDC)&lt;BR /&gt;
the &lt;CODE&gt;app_version&lt;/CODE&gt; gets logged in the &lt;CODE&gt;properties&lt;/CODE&gt; field of the json when the app starts, so all the Spring-related stuff that gets logged when a Spring application starts, contains &lt;CODE&gt;"properties":{"app_version":"1.13"}&lt;/CODE&gt; in the json.&lt;BR /&gt;
But after a few logs, the properties field does not appear anymore, and so doesn't the &lt;CODE&gt;app_version&lt;/CODE&gt;.&lt;BR /&gt;
Can someone help?&lt;/P&gt;

&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 13 Sep 2019 13:19:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Log-field-to-Splunk-using-HEC-appender/m-p/480683#M100218</guid>
      <dc:creator>dlarah</dc:creator>
      <dc:date>2019-09-13T13:19:58Z</dc:date>
    </item>
  </channel>
</rss>

