When you have a server you want to get metric, logs and data to measure the server performance, in this blog post we’ll send rsyslog to S3 and we’ll use fluentd.
Create IAM user
You’ll need a IAM user to send data to S3 so that user will need permissions to do so.
create the new user and use it only for this purpose so you can manage your server, S3, IAM for this project.
Create S3 bucket policy with full permissions ONLY to the specific bucket that is intended for the data/logs.
Install Ruby and awscli
apt-get install ruby-fullinstall development tools
apt-get install build-essentialinstall awscli
apt-get install python3-pippip3 install awscliInstall fluentd
gem install fluentdcreate the configuration file
fluentd --setup /etc/fluentedit conf file (sample file here)
vi /etc/fluent/fluent.confSend log messages to Fluentd
edit
vi /etc/rsyslog.confadd
*.* @spinningops.com:5140restart rsyslog
systemctl start rsyslogcheck status
systemctl status rsyslogStart fluentd
fluentd -c fluentd.conffor the full install please check this GitHub LINK
(Visited 1,140 times, 1 visits today)