Skip to content

Instantly share code, notes, and snippets.

@sudheerchamarthi
Created December 20, 2019 19:51
Show Gist options
  • Select an option

  • Save sudheerchamarthi/975432a6b75d4e5ce17449e81082642e to your computer and use it in GitHub Desktop.

Select an option

Save sudheerchamarthi/975432a6b75d4e5ce17449e81082642e to your computer and use it in GitHub Desktop.
RsyslogdDockerfile
FROM ubuntu
RUN apt update && apt install rsyslog -y
RUN echo '$ModLoad imudp \n\
$UDPServerRun 514 \n\
$ModLoad imtcp \n\
$InputTCPServerRun 514 \n\
$template RemoteStore, "/var/log/remote/%$year%/%$Month%/%$Day%/%$Hour%.log" \n\
:source, !isequal, "localhost" -?RemoteStore \n\
:source, isequal, "last" ~ ' > /etc/rsyslog.conf
ENTRYPOINT ["rsyslogd", "-n"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment