![Black Box LS1016A User Manual Download Page 267](http://html.mh-extra.com/html/black-box/ls1016a/ls1016a_user-manual_2763435267.webp)
Chapter 3 - Additional Features
User Guide
267
template("snmptrap -v 1 -c public 10.0.0.1 \"\" \"\" 2 0 \"\" \
.1.3.6.1.2.1.2.2.1.2.1 s \"$FULLDATE $HOST $MSG\" "));
};
4) To write in file :
destination d_file { file(<filename>);};
Example send message to console :
destination d_console { file("/dev/ttyS0");};
Example to write a message in /var/log/messages file:
destination d_message { file("/var/log/messages"); };
5) To write messages to the session of a logged-in user:
destination d_user { usertty("<username>"); };
Example to send message to all sessions with root user logged:
destination d_userroot { usertty("root"); };
6) To send a message to a remote syslogd server:
destination d_udp { udp("<remote IP address>" port(514)); };
Example to send syslogs to syslogd located at 10.0.0.1 :
destination d_udp1 { udp("10.0.0.1" port(514)); };
Task 5: Connect all of the above.
To connect the sources, filters, and actions, use the following statement. (Actions
would be any message coming from one of the listed sources. A match for each of the
filters is sent to the listed destinations.)
log { source(S1); source(S2); ...
filter(F1);filter(F2);...