R3_GET_SYSTEMLOG
Use the R3_GET_SYSTEMLOG script element to read the system log of an SAP system during a defined period of time and store it as text in a file. If you define the name of an application server, the script element retrieves the system log of that server. Otherwise, the central SAP system log is read. By default, created files are stored on the computer where the agent is installed.
Tip: You can prepare and process the system log using script elements for data sequences. R3_GET_SYSTEMLOG is used for this purpose in the EVENT.R3SYSLOG event job in client 0.
-
Use the PREP_PROCESS script function to create a data sequence with the system log data, see PREP_PROCESS.
-
Use a process loop to process the data sequence line by line, see :PROCESS... :TERM_PROCESS... :ENDPROCESS.
-
Read data in individual lines or columns of the data sequence, see GET_PROCESS_LINE.
Transaction: SM21
Interface: Standard
Syntax
R3_GET_SYSTEMLOG FILE=...[,SERVER=...][,FROM_DATE=...][,FROM_TIME=...][,TO_DATE=...][,TO_TIME=...][,ENCODING=...]
Parameters
| Parameter | Description | Format | Default Value |
|---|---|---|---|
| FILE= | Full path and name of the file in which the system log is stored | Name or script literal | n.a. |
| SERVER=
(Optional) |
Name of the SAP application server whose log is retrieved. Specify in the format Host_SID_SYSNR, where Host is the computer name, SID is the SAP system ID, and SYSNR is the SAP instance number. If not specified, the central SAP system log is used. | n.a. | n.a. |
| FROM_DATE=
(Optional) |
Start date of the system log selection | n.a. | 20010101 (YYYYMMDD) |
| FROM_TIME=
(Optional) |
Start time of the system log selection | n.a. | 000000 (HHMMSS) |
| TO_DATE=
(Optional) |
End date of the system log selection | n.a. | Current date (YYYYMMDD) |
| TO_TIME=
(Optional) |
End time of the system log selection | n.a. | 235959 (HHMMSS) |
| ENCODING=
(Optional) |
(missing or bad snippet) | n.a. | ISO-8859-1 |
Examples
The following example reads the central SAP system log for the previous week. The start date is calculated using the SUB_DAYS script function based on the current date.
: RSET &TODAY# = SYS_DATE ('YYYYMMDD')
: RSET &LAST_WEEK# = SUB_DAYS ('YYYYMMDD:&TODAY#', 7)
R3_GET_SYSTEMLOG FILE='c:\t46_systemlog.txt', SERVER=, FROM_DATE='&LAST_WEEK#'
See also: