We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,590 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Log the output of BASH scripts to a Syslog-like format

Log the output of BASH scripts to a Syslog-like format

2
Contributors
1
Reply
1 Day
Discussion Span
3 Months Ago
Last Updated
2
Views
dihmen
Newbie Poster
6 posts since Jul 2008
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Not sure what you are after exactly. Do you want the script results sent to syslog? Do you want the script to send messages to syslog?

There are a few ways of doing this that I can think of off the top of my head.

You can just send a message to the syslog port of your server using net-cat like this:
nc -w0 -u <syslog ip> 514 <<< "SOURCELABEL SYSLOGTAGLABEL This is a message for syslog"

Or you could send the output directly to the logger itself:
echo "This is a test" | logger -i

Is this what you want?

CimmerianX
Posting Pro in Training
498 posts since Jul 2010
Reputation Points: 49
Solved Threads: 59
Skill Endorsements: 10

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0587 seconds using 2.73MB