Log macros are actually a derivative of the general SunScreen variable mechanism. Therefore, the variable naming and value structures exist for log macros, namely:
sys=Screen (optional) name=macroname value="macrobody" description="descriptive text" (optional) enabled | disabled (default is enabled) |
Log macros are configured in the registry using the logmacro edit subcommand of ssadm. For group-Screen installations, they are configured on the primary Screen.
The following is an example of what you would type to display the definition of a non-Screen specific macro, while logged in to the primary Screen:
admin% ssadm -r primary edit Initial edit> logmacro print name=mail-only NAME="mail-only" ENABLED VALUE="svc smtp" DESCRIPTION="SMTP mail" ... |
The following is an example of what you would type to define a non-Screen specific macro, while logged in to the primary Screen:
admin% ssadm -r primary edit Initial edit> logmacro add name=pkts-only value="loglvl pkt" Description="only network packets" edit> quit |
The following is an example of what you would type to define a macro for a specific Screen, while logged in to the primary Screen:
admin% ssadm -r primary edit Initial edit> logmacro add sys=Screenname name=SFO-routing value="port rip src SFO-routers" description="routing activity in SFO district" edit> quit |
Although, the output produced by print surrounds the value of each item in double quotes, these are only necessary on input to protect embedded spaces within the values of items. Also, although print outputs all tag names in capital letters (for example, NAME=), these tags are recognized in a case-insensitive manner on input (for example, name=, Name=, NAME= are equivalent.)
It is also possible to create expediency log macros on any Screen. This is done using logmacro as a subcommand of ssadm (rather than an ssadm edit subcommand). The syntax of the rest of the usage is the same as given above.
The following is an example of what you would type to display the definition of a non-Screen-specific macro, while logged in to the secondary Screen:
admin% ssadm -r secondary logmacro print name=mail-only NAME="mail-only" ENABLED VALUE="svc smtp" DESCRIPTION="SMTP mail" ... |
The following is an example of what you would type to define a macro for a specific Screen, while logged in to the secondary Screen:
admin% ssadm -r secondary logmacro add sys=secondary name=SFO-routing value="port rip src SFO-routers" description="routing activity in SFO district" |
Do not define Screen-nonspecific log macros on secondary Screens.