<?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 How do I get Monitoring for JSON log files in docker host volume mount directories with Splunk Universal Forwarder working? Getting permission issues in Security</title>
    <link>https://community.splunk.com/t5/Security/How-do-I-get-Monitoring-for-JSON-log-files-in-docker-host-volume/m-p/437484#M10260</link>
    <description>&lt;P&gt;I'm working with Splunk Universal Forwarder 6.5.2 and am trying to configure a monitor on the docker volumes directory on docker hosts.&lt;/P&gt;

&lt;P&gt;I have a app configuration "inputs.conf" like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
host=THEHOSTNAMEHERE

[monitor:///var/lib/docker/volumes/splunk-log-store/.*]
sourcetype=json
index=application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the splunk-log-store directory I have a number of .log files with JSON content.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@THEHOSTNAMEHERE ec2-user]# tail -n 100 $SPLUNK_HOME/var/log/splunk/splunkd.log | grep -E 'permission|docker'

05-02-2019 14:19:35.718 +0000 INFO  TailingProcessor - Parsing configuration stanza: monitor:///var/lib/docker/volumes/splunk-log-store/.*.
05-02-2019 14:19:35.719 +0000 INFO  TailingProcessor - Adding watch on path: /var/lib/docker/volumes/splunk-log-store.
05-02-2019 14:19:35.719 +0000 WARN  FilesystemChangeWatcher - error getting attributes of path "/var/lib/docker/volumes/splunk-log-store": Permission denied
05-02-2019 14:19:35.721 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/cron' (hint: Permission denied ,                            UID: 501, GID: 501).
05-02-2019 14:19:35.722 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/secure' (hint: Permission denied ,                            UID: 501, GID: 501).
05-02-2019 14:19:35.722 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/messages' (hint: Permission denied ,                            UID: 501, GID: 501).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, as per above, I'm getting permission errors when the splunk service starts.&lt;/P&gt;

&lt;P&gt;It's running as user "splunk" (UID 501).&lt;/P&gt;

&lt;P&gt;This is the particular error around the directory  I'm trying to monitor:&lt;/P&gt;

&lt;P&gt;WARN  FilesystemChangeWatcher - error getting attributes of path "/var/lib/docker/volumes/splunk-log-store": Permission denied&lt;/P&gt;

&lt;P&gt;I've tried changing the group permissions on the directory to the splunk group and also tried setting full permissions (completely open) as a hacky test but each time I restart the splunk service I still get this permission error.&lt;/P&gt;

&lt;P&gt;Any ideas what I'm doing wrong here?&lt;/P&gt;

&lt;P&gt;I have been able to successfully get syslog logs working by modifying permissions on the /var/log/messages etc... but the same modifications for this docker volume directory just don't seem to work.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 02 May 2019 15:40:49 GMT</pubDate>
    <dc:creator>shodudley</dc:creator>
    <dc:date>2019-05-02T15:40:49Z</dc:date>
    <item>
      <title>How do I get Monitoring for JSON log files in docker host volume mount directories with Splunk Universal Forwarder working? Getting permission issues</title>
      <link>https://community.splunk.com/t5/Security/How-do-I-get-Monitoring-for-JSON-log-files-in-docker-host-volume/m-p/437484#M10260</link>
      <description>&lt;P&gt;I'm working with Splunk Universal Forwarder 6.5.2 and am trying to configure a monitor on the docker volumes directory on docker hosts.&lt;/P&gt;

&lt;P&gt;I have a app configuration "inputs.conf" like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[default]
host=THEHOSTNAMEHERE

[monitor:///var/lib/docker/volumes/splunk-log-store/.*]
sourcetype=json
index=application
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the splunk-log-store directory I have a number of .log files with JSON content.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@THEHOSTNAMEHERE ec2-user]# tail -n 100 $SPLUNK_HOME/var/log/splunk/splunkd.log | grep -E 'permission|docker'

05-02-2019 14:19:35.718 +0000 INFO  TailingProcessor - Parsing configuration stanza: monitor:///var/lib/docker/volumes/splunk-log-store/.*.
05-02-2019 14:19:35.719 +0000 INFO  TailingProcessor - Adding watch on path: /var/lib/docker/volumes/splunk-log-store.
05-02-2019 14:19:35.719 +0000 WARN  FilesystemChangeWatcher - error getting attributes of path "/var/lib/docker/volumes/splunk-log-store": Permission denied
05-02-2019 14:19:35.721 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/cron' (hint: Permission denied ,                            UID: 501, GID: 501).
05-02-2019 14:19:35.722 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/secure' (hint: Permission denied ,                            UID: 501, GID: 501).
05-02-2019 14:19:35.722 +0000 WARN  TailReader - Insufficient permissions to read file='/var/log/messages' (hint: Permission denied ,                            UID: 501, GID: 501).
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However, as per above, I'm getting permission errors when the splunk service starts.&lt;/P&gt;

&lt;P&gt;It's running as user "splunk" (UID 501).&lt;/P&gt;

&lt;P&gt;This is the particular error around the directory  I'm trying to monitor:&lt;/P&gt;

&lt;P&gt;WARN  FilesystemChangeWatcher - error getting attributes of path "/var/lib/docker/volumes/splunk-log-store": Permission denied&lt;/P&gt;

&lt;P&gt;I've tried changing the group permissions on the directory to the splunk group and also tried setting full permissions (completely open) as a hacky test but each time I restart the splunk service I still get this permission error.&lt;/P&gt;

&lt;P&gt;Any ideas what I'm doing wrong here?&lt;/P&gt;

&lt;P&gt;I have been able to successfully get syslog logs working by modifying permissions on the /var/log/messages etc... but the same modifications for this docker volume directory just don't seem to work.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 02 May 2019 15:40:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Security/How-do-I-get-Monitoring-for-JSON-log-files-in-docker-host-volume/m-p/437484#M10260</guid>
      <dc:creator>shodudley</dc:creator>
      <dc:date>2019-05-02T15:40:49Z</dc:date>
    </item>
  </channel>
</rss>

