cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
26007
Views
23
Helpful
12
Replies

Send custom message to syslog

danailpetrov
Level 1
Level 1

Hello guys,

I'm trying to remember what was the command to create a custom messages and send them to the syslog? It was something like 'log send 5 "bla bla bla"' where 5 is facility which should be used when logging "bla bla bla" message to syslog. I tried to find id in command reference but I couldn't find anything.

Thank you in advance!

1 Accepted Solution

Accepted Solutions

There was an enhancement request on this. If you open a TAC case, they will be able to publish this for you so you will have an external document. They can contact lavramov for more information.

View solution in original post

12 Replies 12

Lucien Avramov
Level 10
Level 10

You can use EEM to produce your own syslog messages, no log command that I know of to create a syslog on the router CLI and send it, that I know of.

I found this:

http://supportwiki.cisco.com/ViewWiki/index.php/Tech_Insights:Annotating_Troubleshooting_Sessions

I''ve used this command long time ago, but I just can't remember now.

But I cannot find information about IOS version that support it.

Best regards,

Danail Petrov

Send log XY

Will display on the console the message XY

If you have logging console enabled, then this will send the syslog message XY to the logging server

You can not change the facility though

I'm not quite sure about that. Check this out:

border#send log "To be or not to be"

border#show log | i Console

Console logging: disabled

*Jul 10 01:04:28.510 EEST: %SYS-2-LOGMSG: Message from 322(dpetrov): "To be or not to be"

Even though the console logging is disabled, the log has been successfully sent to the syslog.

I'm 99% sure that I've used command like this to log a few comments as a "history" for my colleagues. In "J" company there is a command like "commit comment 'comment ...'" and I'm sure that I've found an analog for this in Cisco's IOS.

Thank you for your time!

Kind regards,

Danail Petrov

P.s. Nashenec? :)

You are right, even without console logging, send log sends it.

But i dont see how you can change the syslog facility level for send log. It stays as level 2.

As I said, I'm 99% sure that I've found a way to do this. I can't remember now but I've done it :) I even tried to search back in our TACACS+ accounting information to find something - unfortunately without any success.

On the platforms running 12.2(32)SRB and above, there is actually a command : send log

The message will then appear as :

%SYS--LOGMSG: Message from 0():

That feature have only been ported to those platforms for now. You can always request an enhancement via TAC or the account team.

Yep, it's exactly what I need/mean.Can you provide me with an url address for this "feature" on your (cisco's) website?

Kind regards,

Dani

There was an enhancement request on this. If you open a TAC case, they will be able to publish this for you so you will have an external document. They can contact lavramov for more information.

Thank you for your effort and cooperation. I really appreciate it. I won't open a TAC case for now but thanks for the idea too.

Kind regards,

Danail Petrov

Actually, EEM will not allow you to create custom syslog messages. That feature is coming in EEM 3.1. For now, all EEM syslog messages will always have the %HA_EM facility. The Embedded Syslog Manager will allow you to modify messages as they are generated, but you will need to have a message generated first.

There is another option. You can use the "syslog:" file system to create custom messages using tclsh. Messages will be sent using buginf() (i.e. the same way debugging messages are sent). The attached simple tclsh script will allow you to make use of this feature:

tclsh send_syslog.tcl FACILITY SEVERITY MNEMONIC BODY

For example:

tclsh flash:/send_syslog.tcl MARCUS 1 XXX "This is a test"

Thank you so much for this hint. I didn't knew that TCL has such function (buginf()).

Best regards,

Danail Petrov

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: