In order to start collection you need to specify the following information. Variables in bold denote a mandatory variable:
- LOGZ_TOKEN: Your Logz.io App Token.
- TYPE: The log type that is being sent. This enables better parsing of your log data. It is hi
- HOSTNAME: The hostname you with to associate with performance data sent by this container. This string will be provided in the syslog5424_host field of each entry.
- INSTANCE: The IP address that will be provided in the instance field of each entry.
##Host file mapping
In order to ship a log file, it has to be mapped to the running container. This is performed with the -v option:
-v <log file to ship>:/host/file:ro
docker run -d \ -v /var/log/nginx/access.log:/host/file -e LOGZ_TOKEN="QWERTYQWERTYQWERTYQ" \ -e TYPE=nginx \ -e HOSTNAME=`hostname` \ -e INSTANCE="10.1.2.3" \ --restart=always \ logzio/logzio-logshipper
- In the above example the log file that is shipped is /var/log/nginx/access.log, the hostname that will be passed to the container is generated by the hostname command, and nginx is useful tag for nginx access log.