Find Information in Error Log or Transaction Log

amps-grep

amps-grep is a utility used to search AMPS error logs and journal files. The utility supports both literal search terms and regular expressions. The utility is aware of the structure of AMPS error messages, and returns the full text of a matching error rather than simply the line that matches.

The utility can search for a literal match, or use regular expressions. The regular expression dialect supported is the full set of regular expressions supported by the Python re module.

Options and Parameters

Option

Description

files (required)

The file or files to search.

--version

Show the version number of the program and exit.

--help

Show the help message and exit.

-e, --search_term=TERM

An exact match string to search.

-f, --file=LITERAL_TERMS_FILE

Obtain exact matches from LITERAL_TERMS_FILE, one per line.

-E, --extended_regex=REGEX

Regular expression to search.

-n, --line-number

Include line numbers in results.

-H, --with-filename

Include filename in results.

-h, --no-filename

Do not include filename in results.

-i, --ignore-case

Use case-insensitive matching.

-v, --invert-match

Invert the sense of matching, to select non-matching lines.

--no-data

Do not display data field in journal results.

--include-noops

Include noops in the journal dump.

--client=CLIENTS

Search for records published by a given client. This argument accepts either a client name or a client name hash. This argument can be specified multiple times to search for multiple clients.

amps-grep reads from the standard input if no filenames are provided.

Usage

The following examples shows the output of amps-grep. This example simply searches for any occurrence of the term pubber, the name of a client, in the AMPS log.

$ amps-grep -e pubber trace.out

2017-09-28T16:57:49.8267470-07:00 [26] trace: 12-0010 client[AMPS-Sample-any-tcp-1-212373446269826439] logon command received: {"c":"logon","cid":"0","client_name":"pubber","mt":"nvfix","a":"processed","version":"5.2.1.1.ff11e5c.358302:python"}
2017-09-28T16:57:49.8269820-07:00 [45] info: 1F-0004 [AMPS-Sample-any-tcp-1-212373446269826439] AMPS client session logon for: pubber
client session info:
 client authid           = ''
 client name hash        = 7094790850998930143
 client version          = 5.2.1.1.ff11e5c.358302:python
 last acked client seq   = 0
 last txn log client seq = 0
 correlation id          =
2017-09-28T16:57:49.8270020-07:00 [45] trace: 17-0002 client[pubber] ack sent: {"c":"ack","cid":"0","s":0,"bm":"7094790850998930143|0|","client_name":"pubber","a":"processed","status":"success","reason":"authentication disabled","version":"5.2.1.17.717892.e742467"}
2017-09-28T16:57:49.8272340-07:00 [26] trace: 12-0001 client[pubber] publish command received: {"c":"p","t":"test"}Data=0^A
2017-09-28T16:57:49.8281260-07:00 [26] trace: 12-0001 client[pubber] publish command received: {"c":"p","t":"test"}Data=5^A
2017-09-28T16:57:49.8281840-07:00 [26] info: 07-0013 client[pubber] disconnected.
2017-09-28T16:57:49.8282820-07:00 [26] info: 16-0004 client[pubber] 0 queued sow requests canceled.

Last updated

Copyright 2013-2024 60East Technologies, Inc.