<?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: Send a hostname tag via universalforwarder using Docker-Compose in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521571#M88120</link>
    <description>&lt;P&gt;Yes we can change the host name for docker container.&lt;/P&gt;&lt;P&gt;Can you try to run&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;docker run --hostname=&lt;SPAN class="highlight"&gt;value&lt;/SPAN&gt; OR docker run -h &lt;SPAN class="highlight"&gt;value&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In place of value you can specify your hostname.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------&lt;/P&gt;&lt;P&gt;If this helps you your like will be appreciated &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Sep 2020 00:07:05 GMT</pubDate>
    <dc:creator>vikramyadav</dc:creator>
    <dc:date>2020-09-26T00:07:05Z</dc:date>
    <item>
      <title>Send a hostname tag via universalforwarder using Docker-Compose</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521567#M88119</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I'm configuring a docker-compose responsible to start a cluster of an application and then Splunk and the&amp;nbsp;universalforwarder.&lt;/P&gt;&lt;P&gt;It is working, but I don't have any tag to inform from which container the log came.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any way to add a tag with the hostname?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;I have the docker-compose below, and I'll scale myapp to 3 instances.&lt;/P&gt;&lt;P&gt;Each instance will receive a random hostname by docker-compose, but the path of the log for all instances is the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I add the &lt;STRONG&gt;myapp hostname &lt;/STRONG&gt;as a tag to Splunk?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Because using the&amp;nbsp;universalforwarder, the value of the field &lt;STRONG&gt;hostname &lt;/STRONG&gt;for all logs is the hostname of the&amp;nbsp;universalforwarder container, in my case &lt;STRONG&gt;splunkforwarder&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;myapp:
    image: myapp/myapp:latest
    environment:
      - LOG_PATH=/opt/myapp/logs
    ports:
      - "8080"
    volumes:
      - log_volume_splunk:/opt/myapp/logs
splunk:
    image: splunk/splunk:8.0
    hostname: splunk
    container_name: splunk
    environment:
      - SPLUNK_START_ARGS=--accept-license
      - SPLUNK_USER=root
      - SPLUNK_ENABLE_LISTEN=9997
      - SPLUNK_PASSWORD=password
    ports:
      - "8000:8000"
splunkforwarder:
    image: splunk/universalforwarder:8.0
    hostname: splunkforwarder
    container_name: splunkforwarder
    environment:
      - SPLUNK_START_ARGS=--accept-license --answer-yes
      - SPLUNK_STANDALONE_URL=splunk:9997
      - SPLUNK_USER=root
      - SPLUNK_ADD=monitor /opt/myapp/logs
      - SPLUNK_PASSWORD=password
    restart: always
    depends_on:
      - splunk
    volumes:
      - log_volume_splunk:/opt/myapp/logs&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 12:02:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521567#M88119</guid>
      <dc:creator>juliofalbo</dc:creator>
      <dc:date>2020-09-26T12:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Send a hostname tag via universalforwarder using Docker-Compose</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521571#M88120</link>
      <description>&lt;P&gt;Yes we can change the host name for docker container.&lt;/P&gt;&lt;P&gt;Can you try to run&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;docker run --hostname=&lt;SPAN class="highlight"&gt;value&lt;/SPAN&gt; OR docker run -h &lt;SPAN class="highlight"&gt;value&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;In place of value you can specify your hostname.&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------&lt;/P&gt;&lt;P&gt;If this helps you your like will be appreciated &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 00:07:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521571#M88120</guid>
      <dc:creator>vikramyadav</dc:creator>
      <dc:date>2020-09-26T00:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Send a hostname tag via universalforwarder using Docker-Compose</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521606#M88127</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/109761"&gt;@vikramyadav&lt;/a&gt;&amp;nbsp;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help but unfortunately it is not working.&lt;/P&gt;&lt;P&gt;As you can see I'm using docker-compose and using the scale strategy of docker-compose.&lt;/P&gt;&lt;P&gt;Doing that docker-compose will add automatically a random hostname to my containers, but the problem is that the &lt;STRONG&gt;hostname&lt;/STRONG&gt; field in my Splunk is: &lt;STRONG&gt;splunkforwarder&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;splunkforwarder &lt;/STRONG&gt;is the &lt;STRONG&gt;hostname&lt;/STRONG&gt; of the &lt;STRONG&gt;container&lt;/STRONG&gt; that I added for the image&amp;nbsp;&lt;STRONG&gt;splunk/universalforwarder:8.0&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Sep 2020 11:57:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Send-a-hostname-tag-via-universalforwarder-using-Docker-Compose/m-p/521606#M88127</guid>
      <dc:creator>juliofalbo</dc:creator>
      <dc:date>2020-09-26T11:57:46Z</dc:date>
    </item>
  </channel>
</rss>

