dumpsyslog(4.3)
Usage
dumpsyslog [-n <N>] [-b] [-m] [-s <I|W|E|D|T> [-d <DATE>] [-h <HOUR>] [-f <FILENAME>] [ -t ] [-q <C|S|D>]
Example: dumpsyslog -d 1970-01-01
will give all log entries for the specified date
Example: dumpsyslog -d "1970-01-01 2020-06-26"
will give all log entries between the two dates.
-n enter the (max) number of entries to display (entries are displayed starting from the end of the log, unless -n is used together with -b option)
-b entries are shown starting from the beginning of the log (used in conjunction with -n option)
-s severity types to display
-d filter for a certain date or date interval
-h filter for hour or time interval
-f direct output to a file
-t display stacktraces
-m display full log message
-q query mode
C gives the number of entries
S number of information/warning etc
D earliest/latest date of entries
This command allows you to display and save entries from the System Log.
Options
Option | Description |
---|---|
[-n <N>] | Maximum number |
[-b] | Select entries from the beginning of the System Log, that is, the oldest entries instead of the most recent entries. This option is preferably used in conjunction with the |
[[ -s ]] | Displays the severity type for each entry. The possible severity types are: I - Information |
[-d <DATE>] | Filter on a certain date or time interval. The date must be given in the format specified in the If only one date is given, the display will hold entries for that date only (time 00:00:00 to 23:59:59), unless the
Will give all log entries for the specified date from 00:00:00 to 23:59:59. If an interval is given, the entries must be enclosed within quotation marks "d1 d2":
Will give all log entries between the two dates, from date1 (time 00:00:00) to date2 (time 23:59:59). |
[-h <HOUR>] | Filter on a certain hour or time interval. Time is given in the format If only one time is given, the display will hold entries for that hour only (time 00:00:00 to 00:59:59). If giving two times, all entries in the interval will be displayed. Note!If both date and time intervals are entered; |
[-f <FILENAME>] | Direct output to a file (including directory path). |
[-q <C|S|D>] | Displays general information about the System Log entries. C - Number of entries |
[-t] | To include stack trace information in the System Log printout. |
[-m] | Sometimes log messages can get truncated, so use this flag to display complete log messages. |
Return Codes
Listed below are the different return codes for the dumpsyslog
 command:
Code | Description |
---|---|
0 | Will be returned if the command was successful. |
1 | Will be returned if there was a problem parsing command parameters. |
2 | Will be returned if there was an error when trying to access the system log database. |
3 | Will be returned if the output file already exists, or in the event of file write errors. |
Â