OpenScript

Reply
N/A
jhartley
Posts: 1
Registered: ‎09-16-2010

Any handy logging details/options?

Using the script profile, it's easy for someone with strict logging requirements to send "print" output to their configured syslog servers.  Something that is common in CSW-based logging is customizing the log output using variables.

What are some useful options for customizing log text/output in OpenScript?

Occasional Contributor
Derek_Kang
Posts: 50
Registered: ‎12-14-2011

Re: Any handy logging details/options?

On the second thought, I might have given you an answer in a different direction. Thought it's not possible to manipulate a syslog message generated by the ADX except those printed by the OpenScript engine, you could easily manipulate OpenScript print messages.

For example, the script below will send a client IP address along with an URL in an HTTP GET request received to a syslog server.

sub HTTP_REQUEST {

  my $client_ip = OS_IP::src;

  my $client_url = OS_HTTP_REQUEST::url;

  print "Client IP = $client_ip , URL = $client_url \n";
}

###################################

(My original response) First off, it's a great question.

As you pointed out, all the print outputs in an OpenScript code can be redirected to a sylog server by binding a script profile to a script with "print-output syslog" option as follows:

logging 1.1.1.10

script-profile sp1

  print-output syslog

server virtual v1 1.1.1.1

  port 80 script test.pl script-profile sp1

  bind 80 rs1 80

However, currently, it's not possible to customize the syslog output messages because there's no API provided to manipuate syslog messages.

I think that such an API will be useful and I will provide a feedback to Brocade ADP team for future enhancements.

Message was edited by: Derek_Kang

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.