<?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: Container name for host using splunk universal forwarder in Deployment Architecture</title>
    <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212783#M21624</link>
    <description>&lt;P&gt;Oh very interesting.  I took a look at /host/containers/&lt;/P&gt;

&lt;P&gt;root@splunkuniversalforwarder:/opt/splunk# ls -lah /host/containers/&lt;BR /&gt;
total 36K&lt;BR /&gt;
drwx------. 9 root root 4.0K Nov  8 18:14 .&lt;BR /&gt;
drwxr-xr-x  3 root root   24 Nov  8 18:14 ..&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 0bda263c181e2d5b36d4a66c97dbf227f0aeb8f5708bc75469c5776e7cb1ab0d&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 0fb22ca44d6a781dd3005d3972f1986928266eb0d0d5584f835d11799d220c27&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 526edb07ef9255307dba4b841891f33125f4d3fd81667565229232a5debc901f&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 710257a95c0c6c71ef88f508d0110211de86908b4886ca47828664ca91d2021b&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 738ea4b1ca161c6c2f80698c8249e31565f6fed4e47da163c47ec68c25bc3c07&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 753b3561356f0475216da4221797f038a1b3a79e340e260fbf7b390d166b1e3c&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57&lt;/P&gt;

&lt;P&gt;And then picked one and ran:&lt;BR /&gt;
ls -lah /host/containers/c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57/&lt;/P&gt;

&lt;P&gt;which returned:&lt;/P&gt;

&lt;P&gt;total 40K&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 .&lt;BR /&gt;
drwx------. 9 root root 4.0K Nov  8 18:14 ..&lt;BR /&gt;
-rw-r-----  1 root root    0 Nov  8 18:14 c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57-json.log&lt;BR /&gt;
-rw-rw-rw-  1 root root 3.3K Nov  8 18:37 config.v2.json&lt;BR /&gt;
-rw-rw-rw-  1 root root 1.1K Nov  8 18:37 hostconfig.json&lt;BR /&gt;
-rw-r--r--  1 root root   13 Nov  8 18:37 hostname&lt;BR /&gt;
-rw-r--r--  1 root root  150 Nov  8 18:37 hosts&lt;BR /&gt;
-rw-r--r--  1 root root   76 Nov  8 18:37 resolv.conf&lt;BR /&gt;
-rw-r--r--  1 root root   71 Nov  8 18:37 resolv.conf.hash&lt;BR /&gt;
drwx------  2 root root 4.0K Nov  8 18:14 shm&lt;/P&gt;

&lt;P&gt;Lastly I cat'd the hostname file in that folder and it shows the 12 digit container id c76778c03115&lt;/P&gt;</description>
    <pubDate>Tue, 08 Nov 2016 18:42:10 GMT</pubDate>
    <dc:creator>ppierson</dc:creator>
    <dc:date>2016-11-08T18:42:10Z</dc:date>
    <item>
      <title>Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212773#M21614</link>
      <description>&lt;P&gt;I am using the universal forwarder to collect logs from docker hosts however when i see the docker containers it has collected logs from it only shows the shortened version of their docker container id.  The universal forwarder is listed correctly but the rest are not. Does anyone know how to correct this?&lt;/P&gt;

&lt;P&gt;The output looks like so:&lt;/P&gt;

&lt;P&gt;Host            Count       Last Update &lt;BR /&gt;
0c3344bac2fe    Quick Report    76  11/6/16 4:55:30.000 AM&lt;BR /&gt;
3708dc8f8aff    Quick Report    4   11/6/16 4:55:30.000 AM&lt;BR /&gt;
9efb179e4653    Quick Report    13  11/6/16 4:55:30.000 AM&lt;BR /&gt;
a043ad123e05    Quick Report    5   11/6/16 4:55:30.000 AM&lt;BR /&gt;
dcbb531a48a0    Quick Report    166 11/6/16 4:55:30.000 AM&lt;BR /&gt;
e3a71cd5188e    Quick Report    34  11/6/16 4:55:30.000 AM&lt;BR /&gt;
f93768a45cba    Quick Report    84  11/6/16 4:55:30.000 AM&lt;BR /&gt;
splunkuniversalforwarder    Quick Report    5,831   11/6/16 5:05:15.000 AM&lt;/P&gt;

&lt;P&gt;As you can see above only splunkuniversalforwarder is named correctly.&lt;/P&gt;</description>
      <pubDate>Sun, 06 Nov 2016 05:04:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212773#M21614</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-06T05:04:17Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212774#M21615</link>
      <description>&lt;P&gt;Have you tried editing server.conf on each of the containers and restarting splunk on them?&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Serverconf"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.0/Admin/Serverconf&lt;/A&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[general]
serverName = &amp;lt;ASCII string&amp;gt;
* The name used to identify this Splunk instance for features such as
  distributed search.
* Defaults to &amp;lt;hostname&amp;gt;-&amp;lt;user running splunk&amp;gt;.
* Shall not be an empty string
* May contain environment variables
* After any environment variables have been expanded, the server name
  (if not an IPv6 address) can only contain letters, numbers, underscores,
  dots, and dashes; and it must start with a letter, number, or an
  underscore.
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Nov 2016 14:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212774#M21615</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T14:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212775#M21616</link>
      <description>&lt;P&gt;Splunk universal forwarder (SUF) isnt installed on each container.  SUF is running as a container and is collecting the logs of each container from the stdout log of each container.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:02:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212775#M21616</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T15:02:57Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212776#M21617</link>
      <description>&lt;P&gt;Can you modify your container scripts/images to modify the server.conf upon launch?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:22:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212776#M21617</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T15:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212777#M21618</link>
      <description>&lt;P&gt;Not really sure what you mean? the containers are properly named.  SUF doesnt look at that though because it is pulling the logs that docker posts in json format on the host.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:25:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212777#M21618</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T15:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212778#M21619</link>
      <description>&lt;P&gt;O. I. C. I misread your reply.&lt;/P&gt;

&lt;P&gt;When you pull data into splunk you can specify the host names.  How are you getting the docker logs into Splunk?  &lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 15:51:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212778#M21619</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T15:51:09Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212779#M21620</link>
      <description>&lt;P&gt;from what I understand (again I am fairly new to Splunk) Splunk Universal Forwarder is pulling the docker logs via the location that docker saves them to on the host and pushes them to Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 16:00:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212779#M21620</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T16:00:49Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212780#M21621</link>
      <description>&lt;P&gt;Ok so then you should have an inputs.conf somewhere that mentions the log files path.  Can you find that and post it here please?&lt;/P&gt;

&lt;P&gt;An easy way to get it is using the btool command:&lt;/P&gt;

&lt;P&gt;/opt/splunkforwarder/bin/splunk btool inputs list --debug&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 16:22:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212780#M21621</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T16:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212781#M21622</link>
      <description>&lt;P&gt;Hope this helps? Thanks for the input.&lt;/P&gt;

&lt;P&gt;Added to pastebin because it was too long for the amount of characters available. &lt;A href="http://pastebin.com/C30iLrDv"&gt;http://pastebin.com/C30iLrDv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 18:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212781#M21622</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T18:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212782#M21623</link>
      <description>&lt;P&gt;Line 64 on you pastebin is an inputs.conf stanza in your docker ta app.  This is what is "figuring" out the container name and it is a regex that's being applied to the path of the docker logs to extract the instance names.&lt;/P&gt;

&lt;P&gt;If you'll open that docker log path and see if they contain the full name or the shortened name, then we can proceed with a solution.  If the full name is listed, can you provide examples so we can give you a regex that should work.  If the short name is listed then we will need to make your logging more verbose or set different logging options within docker.&lt;/P&gt;

&lt;P&gt;The path is after monitor:// on line 59 in your paste.  Where you see the * is where the short or long instance names should appear.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 18:34:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212782#M21623</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T18:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212783#M21624</link>
      <description>&lt;P&gt;Oh very interesting.  I took a look at /host/containers/&lt;/P&gt;

&lt;P&gt;root@splunkuniversalforwarder:/opt/splunk# ls -lah /host/containers/&lt;BR /&gt;
total 36K&lt;BR /&gt;
drwx------. 9 root root 4.0K Nov  8 18:14 .&lt;BR /&gt;
drwxr-xr-x  3 root root   24 Nov  8 18:14 ..&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 0bda263c181e2d5b36d4a66c97dbf227f0aeb8f5708bc75469c5776e7cb1ab0d&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 0fb22ca44d6a781dd3005d3972f1986928266eb0d0d5584f835d11799d220c27&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 526edb07ef9255307dba4b841891f33125f4d3fd81667565229232a5debc901f&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 710257a95c0c6c71ef88f508d0110211de86908b4886ca47828664ca91d2021b&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 738ea4b1ca161c6c2f80698c8249e31565f6fed4e47da163c47ec68c25bc3c07&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 753b3561356f0475216da4221797f038a1b3a79e340e260fbf7b390d166b1e3c&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57&lt;/P&gt;

&lt;P&gt;And then picked one and ran:&lt;BR /&gt;
ls -lah /host/containers/c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57/&lt;/P&gt;

&lt;P&gt;which returned:&lt;/P&gt;

&lt;P&gt;total 40K&lt;BR /&gt;
drwx------  3 root root 4.0K Nov  8 18:37 .&lt;BR /&gt;
drwx------. 9 root root 4.0K Nov  8 18:14 ..&lt;BR /&gt;
-rw-r-----  1 root root    0 Nov  8 18:14 c76778c03115dc5b3ca350729b8a137b33d636ee47366061d3c3acf3a3631f57-json.log&lt;BR /&gt;
-rw-rw-rw-  1 root root 3.3K Nov  8 18:37 config.v2.json&lt;BR /&gt;
-rw-rw-rw-  1 root root 1.1K Nov  8 18:37 hostconfig.json&lt;BR /&gt;
-rw-r--r--  1 root root   13 Nov  8 18:37 hostname&lt;BR /&gt;
-rw-r--r--  1 root root  150 Nov  8 18:37 hosts&lt;BR /&gt;
-rw-r--r--  1 root root   76 Nov  8 18:37 resolv.conf&lt;BR /&gt;
-rw-r--r--  1 root root   71 Nov  8 18:37 resolv.conf.hash&lt;BR /&gt;
drwx------  2 root root 4.0K Nov  8 18:14 shm&lt;/P&gt;

&lt;P&gt;Lastly I cat'd the hostname file in that folder and it shows the 12 digit container id c76778c03115&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 18:42:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212783#M21624</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T18:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212784#M21625</link>
      <description>&lt;P&gt;It looks like if I run the regex ("(Name)":"((\"|[^"])*)") on the config.v2.json file it name is listed but I now have to figure out how to get splunk universal forwarder to use that instead.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 22:37:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212784#M21625</guid>
      <dc:creator>ppierson</dc:creator>
      <dc:date>2016-11-08T22:37:18Z</dc:date>
    </item>
    <item>
      <title>Re: Container name for host using splunk universal forwarder</title>
      <link>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212785#M21626</link>
      <description>&lt;P&gt;It'll be easy.  On line 64 in  your pastebin.  Find that inputs.conf in the docker ta app... And change the {12} to {64}. Or however many characters there are in those long container names.  Then restart the universal forwarder.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2016 23:02:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Deployment-Architecture/Container-name-for-host-using-splunk-universal-forwarder/m-p/212785#M21626</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-11-08T23:02:24Z</dc:date>
    </item>
  </channel>
</rss>

