Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Fetching address and user details from log file Post 303018113 by RudiC on Tuesday 29th of May 2018 10:03:56 AM
Old 05-29-2018
Try

Code:
gunzip log.2018-05-23.gz | awk '
BEGIN                           {HD = "Date    Program    line1    line2    city    stateCode    postalCode    countryCode"
                                 MX = split(HD, HDFLDS)
                                }

/CartService/                   {TMP = $1 " " $2 OFS $5
                                }

/Failed to calculate US Tax.*{/ {while (!(T1 ~ /}/))    {getline T1
                                                         gsub (/ *" */, _, T1)
                                                         split (T1, T2, ":")
                                                         OUT[T2[1]] = T2[2]
                                                        }

                                 if (!HDprinted) print HD
                                 HDprinted = 1

                                 printf "%s", TMP
                                 for (i=3; i<=MX; i++) printf OFS "%s", OUT[HDFLDS[i]]
                                  printf ORS


                                 TMP = T1 = ""
                                 split ("", OUT)
                                }

 ' OFS="\t"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read relevent details from Log File

Hi All, We have requirement to read XML details from large Log File and save in new file name. I have enclosed the sample xml which has start tag <OUTBOUND_MESSAGE xmlns="http://www.abc.com"> and the end tag as </OUTBOUND_MESSAGE> The log file contains many lines with other details which... (6 Replies)
Discussion started by: thinakarmani
6 Replies

2. UNIX for Dummies Questions & Answers

logging SFTP details in a log file...

hi all..... i want to know how to log the details when logging into a server using SFTP......in FTP i used something like (ftp -uv<xxx.srp>>log_file.log) where the details will be logged to log_file...is there any options for doing the same in SFTP....i wanted to display the details abt... (4 Replies)
Discussion started by: santy
4 Replies

3. UNIX for Dummies Questions & Answers

Script for parsing details in a log file to a seperate file

Hi Experts, Im a new bee for scripting, I would ned to do the following via linux shell scripting, I have an application which throws a log file, on each action of a particular work with the application, as sson as the action is done, the log file would vanish or stops updating there, the... (2 Replies)
Discussion started by: pingnagan
2 Replies

4. Solaris

user logon details

how can i identifying whose are logged in last few days,time and date also want. what i will do for get that information (2 Replies)
Discussion started by: sijocg
2 Replies

5. UNIX for Dummies Questions & Answers

Panic kernal-mode address fault on user address 0x14

:) Firstly Hi all!!, im NEW!! and on here hoping that someone might be able to offer me some help... i have a server that keeps crashing every few days with the error message: PANIC KERNAL-MODE ADDRESS FAULT ON USER ADDRESS 0X14 KERNAL PAGE FAULT FROM (CS:EIP)=(100:EF71B5BD) EAX=EF822000... (10 Replies)
Discussion started by: Twix
10 Replies

6. Solaris

Command History for a user with IP details

Hi We are sharing our envoirnment with our component teams. the plateform is SunOS 5.8 Generic_117350-41 sun4u sparc SUNW,Sun-Fire-V490. All team logs in the domain with same user and perform activities. Now for the system auditing purpose can somebody guide me how can I get the details when... (6 Replies)
Discussion started by: sukhvinder_Tm
6 Replies

7. Shell Programming and Scripting

Formatting Report and Reading data and fetching the details from contents file

Data I was trying to write shell script which will be return the output in the below format First i was trying to do these using sed. sed -n '/.ksh/p' mainksh.ksh sed -e 's/*\(.*\)/\1/g' mainksh.ksh $RUN_DIR, $SUB_DIR and the variables which will be defined in the profile file. when i am... (0 Replies)
Discussion started by: rameshds
0 Replies

8. Shell Programming and Scripting

Extract IP Address from Log File

I have a log file with several IP addresses in it:- 2012-12-06 16:05:05,885 NOTICE **SNMP** Alarm was created: (LicenseClientRejected) Client Remote Peer /125.111.64.125:2573 was Rejected Property=/125.111.64.125:2573, Client Remote Peer /125.111.64.125:2573 was Rejected **SNMP**.... (5 Replies)
Discussion started by: BHM
5 Replies

9. Shell Programming and Scripting

How to log file processing details to database table usnig UNIX shell script?

we are getting files on daily basis.we need to process these files. i need a unix shell script where we can count 1-The no of files processed 2-No of data/record processed for each files. The script should log these details into a database table. If there is any error while file... (3 Replies)
Discussion started by: Atul kumar
3 Replies

10. Cybersecurity

You are being directed to the US FBI where your IP address and details will also be logged.

Well, I thought I would share this code, which I normally do not share. The logs show this site is currently experiencing some "new hack" maybe attempting a buffer overflow or something similar. So, not really having any patience for this kind of criminal or childish behavior (have a touch... (7 Replies)
Discussion started by: Neo
7 Replies
BOS_GETLOG(8)						       AFS Command Reference						     BOS_GETLOG(8)

NAME
       bos_getlog - Prints a server process's log file

SYNOPSIS
       bos getlog -server <machine name> -file <log file to examine>
	   [-cell <cell name>] [-noauth] [-localauth] [-help]

       bos getl -s <machine name> -f <log file to examine>
	   [-c <cell name>] [-n] [-l] [-h]

DESCRIPTION
       The bos getlog command displays on the standard output stream the specified log file from the machine named by the -server argument. The
       BOS Server fetches the log file from the /var/log/openafs directory unless an alternate pathname is provided as part of the -file argument.

CAUTIONS
       Log files can grow quite large, especially for the database server processes. To keep them to a manageable size, periodically either use
       the UNIX rm command to truncate each log file, or use the bos restart command to restart each process.

       It can take up to five minutes after the file is removed or process restarted for the space occupied by a log file to become available.

OPTIONS
       -server <machine name>
	   Indicates the server machine from which to retrieve the log file.  Identify the machine by IP address or its host name (either fully-
	   qualified or abbreviated unambiguously). For details, see bos(8).

       -file <log file to examine>
	   Names the log file to display. If a filename only is provided, the BOS Server fetches the log file from the /var/log/openafs directory;
	   the standard values are:

	   AuthLog
	       The Authentication Server (kaserver) log file.

	   BackupLog
	       The Backup Server (buserver) log file.

	   BosLog
	       The BOS Server (bosserver) log file.

	   FileLog
	       The File Server (fileserver) log file.

	   SalvageLog
	       The Salvager (salvager) log file.

	   VLLog
	       The Volume Location (VL) Server (vlserver) log file.

	   VolserLog
	       The Volume Server (volserver) log file.

	   If a pathname and filename are provided, the log file is retrieved from the indicated directory. Partial pathnames are interpreted
	   relative to the /var/log/openafs directory.

       -cell <cell name>
	   Names the cell in which to run the command. Do not combine this argument with the -localauth flag. For more details, see bos(8).

       -noauth
	   Assigns the unprivileged identity "anonymous" to the issuer. Do not combine this flag with the -localauth flag. For more details, see
	   bos(8).

       -localauth
	   Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. The bos command interpreter presents the ticket
	   to the BOS Server during mutual authentication. Do not combine this flag with the -cell or -noauth options. For more details, see
	   bos(8).

       -help
	   Prints the online help for this command. All other valid options are ignored.

OUTPUT
       The output is preceded by the line

	  Fetching log file '<filename>'...

       The remainder of the output depends on the particular log file.

EXAMPLES
       The following example displays the FileLog file from the machine "fs3.abc.com":

	  % bos getlog -server fs3.abc.com -file FileLog
	  Fetching log file 'FileLog'...
	  Sun Nov 8 04:00:34 1998 File server starting
	  Sun Nov 8 04:00:39 1998 Partition /vicepa:  attached 21 volumes;
				  0 volumes not attached
	  Sun Nov 8 04:00:40 1998 File Server started Sun Nov 8 04:00:40
				  1998
	  Mon Nov 9 21:45:06 1998 CB: RCallBack (zero fid probe in host.c)
				  failed for host 28cf37c0.22811

PRIVILEGE REQUIRED
       The issuer must be listed in the /etc/openafs/server/UserList file on the machine named by the -server argument, or must be logged onto a
       server machine as the local superuser "root" if the -localauth flag is included.

       When a server is in restricted mode, bos getlog can only return the contents of the salvager's log.

SEE ALSO
       bos(8)

COPYRIGHT
       IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.

       This documentation is covered by the IBM Public License Version 1.0.  It was converted from HTML to POD by software written by Chas
       Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.

OpenAFS 							    2012-03-26							     BOS_GETLOG(8)
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy