I do have another question related to this topic.
This may be a simple fix, but as you previously know my coding is on the basic side.
With the python script shipper.py, I've noticed that some of the messages from my log file are not making it through and also some additional junk in the message field (not as important as data being removed from lines).
I'm guessing the script is picking up some lines that may be python script and not bringing it through to the message field, examples below:
Original text:
Code: Select all
2016-02-19 23:58:27,789 DEBUG [UserManager.logAccess:720 ] <regularProcess> has logged out.
message field after being shipped to NLS using shipper.py
Code: Select all
{"message": "2016-02-19 23:58:27,789 DEBUG [UserManager.logAccess:720 ] has logged out.\r\n"}
as you can see the <regularProcess> has been filtered out and there is junk at the start and end of the line.
My initial thoughts were, I am happy for the lines of my logs to come through as is (non-json). Something like a read line by line and echo each line and push it through to the log server.
Code: Select all
while read line
do
echo **read line** | nc 123.456.78.912 2056
done < server.log
Sorry I don't know the proper syntax, but something along those lines would it work and would it be okay to do?