Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Announcements

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

Send custom message to syslog

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

Re: Send custom message to syslog

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.

12 REPLIES

Re: Send custom message to syslog

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.

New Member

Re: Send custom message to syslog

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

Re: Send custom message to syslog

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

New Member

Re: Send custom message to syslog

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? :)

Re: Send custom message to syslog

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.

New Member

Re: Send custom message to syslog

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.

Re: Send custom message to syslog

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.

New Member

Re: Send custom message to syslog

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

Re: Send custom message to syslog

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.

New Member

Re: Send custom message to syslog

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

Cisco Employee

Re: Send custom message to syslog

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"

New Member

Re: Send custom message to syslog

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

Best regards,

Danail Petrov

2559
Views
13
Helpful
12
Replies