Q on <user> of syslog message generated by logger command


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Q on <user> of syslog message generated by logger command
# 1  
Old 04-16-2009
Q on <user> of syslog message generated by logger command

Generally(at least on AIX5.3, Solaris9, OS X)'logger' command would create syslog messages which carry <login name> . On Solaris9, I have experienced two circumstances in which 'logname' command fails. In this circumstance I saw the 'logger' command generated syslog messages which carry alternatively <real or effective user name> instead of the <login name> that is seemingly unable for the logger to retrieve. One of the circumstances is on shells(either ksh or csh) running on the emacs buffer. For the other one, sorry, I can not tell you here.
Are there any ways by which we can let the logger to create syslog messages with <real or effective user name> instead of <login name>?

Thanks,
masaki

correction: replaced "effective" with "real or effective"

Last edited by masaki; 04-16-2009 at 03:34 AM.. Reason: to be more accurate
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Logger command not working for one script

Hi, On RHEL 7.2, I created below script in cronjob for every minute. If this process is found to be not running, it should record message in /var/adm/xymessages, start it and send email. #!/bin/bash source /export/home/prodadm/.bash_profile if ; then ... (8 Replies)
Discussion started by: ron323232
8 Replies

2. Shell Programming and Scripting

Error message while openning the xls file generated by UNIX

Hi All, I have created a unix script to mail the xls file.This is being done using mailx command fdate=`tail -1 abc.xls | cut -c1-8` SUBJECT="CARD GL Exceptions : ${ENV} for ${fdate}" destname=CARD_GL_Exceptions_$fdate sed 's/#BUSINESS/BUSINESS/1' abc.xls > abc2.xls mv abc2.xls abc.xls... (2 Replies)
Discussion started by: karthik adiga
2 Replies

3. Shell Programming and Scripting

Piping the "script" command through the logger command.

I use the snippet below in /etc/profile on RHEL Linux to capture command line logging and it all works well and good. Now I'd like to pipe the same output from script through the logger command so it all gets logged to syslog. The only additional code I've added is in bold below (|... (4 Replies)
Discussion started by: woodson2
4 Replies

4. Shell Programming and Scripting

Files generated by a particular user

Hi I have the following files generated by different users on a directory -rw-rw-r-- 1 NAME1 database03 809 Nov 17 10:41 PCAS_CARD_TRANS_OFF.1111171041.lg -rw-rw-r-- 1 richard ccsdba 10968411 Nov 17 10:43 load_123_RX0_0.1111171016.lg -rw-rw-r-- 1 DEV db03 10713 Nov 17... (5 Replies)
Discussion started by: bobby1015
5 Replies

5. Shell Programming and Scripting

Retrieve logs generated in last 10 mins from a log file using 'grep' command

HI All, I have a log file where the logs will be in the format as given below: 2011-05-25 02:32:51 INFO PROCESS STARTING 2011-05-25 02:32:52 INFO PROCESS STARTED . . . I want to retrieve only the logs which are less than 5 mins older than current time using grep... (3 Replies)
Discussion started by: rvhg16
3 Replies

6. Shell Programming and Scripting

Need a command to delete all files apart from last file generated

Hi, I have a directory named (/output). this directory has files in the below format abc.* , xyz*, djj*, iwe*, weewe*, rier*, 3948903ddfgf* these files are generated at random. what i need to do is. delete all the files of all kinds but keep only the last generated file of... (5 Replies)
Discussion started by: dazdseg
5 Replies

7. Shell Programming and Scripting

Need help in sed command (adding a blank line btw each block generated by pattern)

Hello friends, I have a C source code containing sql statements. I use the following sed command to print all the sql blocks in the source code.... sed -n "/exec sql/,/;/p" Sample.cpp The above sed command will print the sql blocks based on the pattern "exec sql" & ";"... (2 Replies)
Discussion started by: frozensmilz
2 Replies

8. UNIX for Advanced & Expert Users

User of the file OR Logger of the file. ?

How could I get the name of user of a file in a file path ? OR Who i accessing the particular file in a file path ? Any Idea ?? Please help !! Thanks :) (1 Reply)
Discussion started by: varungupta
1 Replies

9. Shell Programming and Scripting

Logger Command

Hi I have a command in a script . /usr/bin/iostat -E I would like to place an entry in /var/adm/messages (via syslog) as a daemon.notice using the logger command but i just cant work out the syntax for this , do I pipe the output of iostat into logger? or is it redirected...can somebody give me... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

10. Post Here to Contact Site Administrators and Moderators

User generated FAQ and Best Practices section

There are some common tasks and best practices that could be shared with the group by all the good people on the board. Having a admin approved/user generated section of this sort might be nice. Often there are lots of tidbits that could be grown into a useful document. Just a thought. ... (5 Replies)
Discussion started by: kduffin
5 Replies
Login or Register to Ask a Question
logger(1B)					     SunOS/BSD Compatibility Package Commands						logger(1B)

NAME
logger - add entries to the system log SYNOPSIS
/usr/ucb/logger [-f filename] [-i] [-p priority] [-t tag] mm [message]... DESCRIPTION
The logger utility provides a method for adding one-line entries to the system log file from the command line. One or more message argu- ments can be given on the command line, in which case each is logged immediately. If message is unspecified, either the file indicated with -f or the standard input is added to the log. Otherwise, a filename can be specified, in which case each line in the file is logged. If neither is specified, logger reads and logs messages on a line-by-line basis from the standard input. OPTIONS
The following options are supported: -i Log the process ID of the logger process with each line. -f filename Use the contents of filename as the message to log. -p priority Enter the message with the specified priority. The message priority can be specified numerically, or as a facility.level pair. For example, `-p local3.info' assigns the message priority to the info level in the local3 facility. The default pri- ority is user.notice. -t tag Mark each line added to the log with the specified tag. EXAMPLES
Example 1 Logging a message The command: example% logger System rebooted will log the message `System rebooted' to the facility at priority notice to be treated by syslogd as other messages to the facility notice are. Example 2 Logging messages from a file The command: example% logger -p local0.notice -t HOSTIDM -f /dev/idmc will read from the file /dev/idmc and will log each line in that file as a message with the tag `HOSTIDM' at priority notice to be treated by syslogd as other messages to the facility local0 are. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWscpu | +-----------------------------+-----------------------------+ SEE ALSO
syslogd(1M), syslog(3C), attributes(5) SunOS 5.11 14 Sep 1992 logger(1B)