Skip to content

Instantly share code, notes, and snippets.

View pierrebeaucamp's full-sized avatar

Pierre Beaucamp pierrebeaucamp

View GitHub Profile
@pozgo
pozgo / logger
Last active October 8, 2015 20:01
Journalctl to file for logstash-forwarder process
#!/bin/bash
is=`ps aux | grep "journalctl -f" | grep -v grep | awk '{print$2}'`
file=/var/log/system.log
msize="12400000" # Max file sieze set to 10MB
asize=`ls -l /var/log/system.log | awk '{print$5}'`
logstaship=`fleetctl list-machines -l | grep logsystem | awk '{print$2}'`
hostname=`hostname`
# Checking the size of log file