Sponsored Content
Top Forums Shell Programming and Scripting Issue with Bash Audit Command Logger script | Need help to debug this Post 303045632 by as7951 on Sunday 5th of April 2020 12:59:15 AM
Old 04-05-2020
Thank you Peasant,

Achieved the solution by another way..
added "PROMPT_COMMAND='history -a >(tee -a ~/.bash_history | logger -t "$USER[$$] $SSH_CONNECTION")'" in /etc/profile and getting logs stored in messages file in /var/log directory...thank you
 

10 More Discussions You Might Find Interesting

1. 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

2. UNIX for Advanced & Expert Users

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... (0 Replies)
Discussion started by: masaki
0 Replies

3. Shell Programming and Scripting

Bash script: issue changing directories in script

I am working on a script that checks two arguments at the command line. The first argument is a search pattern, the second can be a file or a directory, if it is a file a second script is called that checks it for the search pattern. If the second argument is a directory, it checks for the search... (5 Replies)
Discussion started by: Breakology
5 Replies

4. AIX

Aix 5.3 Audit issue - not orking properly

Hello Friends, I had enabled the audit and configured for sysadmin user alone in audit config file. but the audit starts logging for root user alone. Attached the conf file. I want the aduit to record only for sysadmin activities.. need your expertise and help in solving the issue. (1 Reply)
Discussion started by: kmvinay
1 Replies

5. Shell Programming and Scripting

login audit bash script

I am a bash beginner and I need to write an script to check my users login time. This has to be in a format of : This script has to work on a server to check all the users. I know that I have to use "last" command but I have no idea how to do it. any assistance is appreciated. Thanks (17 Replies)
Discussion started by: bashily
17 Replies

6. Shell Programming and Scripting

syntax issue with quotes in mysql command for a bash script

i'm trying to write a bash script that executes a mysql statement mysql -sN -e INSERT INTO "$database"."$tableprefix"users (var1, var2,var3) VALUES (123, '1','') i don't know where to put the quotes it doesnt work with this one: ` it seems i can only put double quotes around the... (0 Replies)
Discussion started by: vanessafan99
0 Replies

7. Shell Programming and Scripting

syntax issue mysql in bash script

I'm running mysql in a bash script mysql <<EOF query EOF one query is like this: UPDATE $dbname.$prefix"config" SET value = $var WHERE "$prefix"config.name = 'table colname'; with variable but it's giving an error i'm not sure what to put for "$prefix"config.name the table... (3 Replies)
Discussion started by: vanessafan99
3 Replies

8. Shell Programming and Scripting

bash ls command file issue

ls -l /md01/EL/MarketData/inbound/ststr/INVENTORY* |tail -5 |awk '{ print $5,$6,$7,$8,$9 }'If I run the above from the command line the output to md_email is formatted correctly as 78213497 May 1 12:50 /md01/EL/MarketData/inbound/ststr/INVENTORY.20120430.PINESTREET.CSV.done 77904740 May 2... (3 Replies)
Discussion started by: smenago
3 Replies

9. 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

10. 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
logger::appender(n)					 Object Oriented logging facility				       logger::appender(n)

__________________________________________________________________________________________________________________________________________________

NAME
logger::appender - Collection of predefined appenders for logger SYNOPSIS
package require Tcl 8.2 package require logger::appender ?1.2? ::logger::appender::console -level level -service service ?options...? ::logger::appender::colorConsole -level level -service service ?options...? _________________________________________________________________ DESCRIPTION
This package provides a predefined set of logger templates. ::logger::appender::console -level level -service service ?options...? -level level Name of the level to fill in as "priority" in the log procedure. -service service Name of the service to fill in as "category" in the log procedure. -appenderArgs appenderArgs Any additional arguments for the log procedure in list form -conversionPattern conversionPattern The log pattern to use (see logger::utils::createLogProc for the allowed substitutions). -procName procName Explicitly set the name of the created procedure. -procNameVar procNameVar Name of the variable to set in the calling context. This variable will contain the name of the procedure. ::logger::appender::colorConsole -level level -service service ?options...? See ::logger::appender::colorConsole for a description of the applicable options. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category logger of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
appender, logger CATEGORY
Programming tools COPYRIGHT
Copyright (c) 2005 Aamer Akhter <aakhter@cisco.com> log 1.2 logger::appender(n)
All times are GMT -4. The time now is 11:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy