Installer 10.15 | Complete Installation and Upgrade Information for Software AG Products | Command Central | Using the Command Line Interface | Diagnostics Logs Commands | sagcc get diagnostics logs
 
sagcc get diagnostics logs
Retrieves log entries from a log file. Log information includes the date, time, and description of events that occurred with a specified run-time component.
Syntax
*Command Central syntax:
You can optionally identify log(s) by supplying either a regular expression or search text.
*To optionally specify a regular expression:
sagcc get  diagnostics logs  node_alias runtime_componentid logid  
{full | tail | head} [lines=number] [(regex=expression
[options]
*To optionally specify search text:
sagcc get  diagnostics logs  node_alias runtime_componentid logid  
{full | tail | head} [lines=number] [search=text]  [options]
*Platform Manager syntax:
You can optionally identify log(s) by supplying either a regular expression or search text.
*To optionally specify a regular expression:
sagcc get  diagnostics logs  runtime_componentid logid    
{full | tail | head} [lines=number] [(regex=expression] [options]
*To optionally specify search text:
sagcc get  diagnostics logs runtime_componentid logid    
{full | tail | head} [lines=number] | head [lines=number]} 
[search=text]  [options]
  
 options:     
[{--debug | -d}]     
[{--error | -r} file]     
[{--log | -l} file]     
[{--output | -o} file]     
[{--password | -p} password]     
[{--quiet | -q}]     
[{--server | -s} url]     
[{--username | -u} user_name]
Arguments and Options
Argument or Option
Description
node_alias
Required. Only for Command Central. Specifies the alias name of the Platform Manager that manages the run-time component for which you want to retrieve information.
You can determine the alias name of the Platform Manager node by using sagcc list landscape nodes
runtime_componentid
Required. Specifies the ID of the run-time component for which you want to retrieve information.
You can determine the IDs for run-time components using sagcc list inventory components.
logid
Required. Specifies the ID of the log for which you want to retrieve information.
You can determine the IDs for logs using sagcc list diagnostics logs.
{full | tail | head}
Required. Identifies the log entries you want to retrieve.
*Specify full to retrieve all log entries.
*Specify tail to retrieve the most recent log entries from the end of the log file.
*Specify head to retrieve entries from the beginning of the log file.
[lines=number]
Optional. Use only with the tail or head parameters.
Specifies the number of log entries to return. If you omit lines=number the command returns 100 entries.
[regex=expression]
Optional. Narrows the retrieved log entries to those that meet the specified regular expression.
[search=text]
Optional. Narrows the retrieved log entries to those that contain the specified search text.
[options]
Optional. Refer to the command syntax for a list of the options the command supports. For a description of the options, see Common Options.
Usage Notes
*By default, the command returns log entries or the full log in plain text format. If you specify a zip file for the output format, the command returns the full log file in a zip archive.
*Specify either regex or search. If you specify both, the command narrows the result using the regular expression you specify with regex and ignores the search text you specify with search.
*If you use regex to specify a regular expression or search to specify search text, and the regular expression or search text identify no log entries, the command returns no results.
*When you use lines with regex or search, the command returns the specified number of lines in the log that contain the specified regular expression or text. When you use lines without regex or search, the command returns the specified number of lines from the top or bottom of the log. For example:
*tail lines=10 search=JMX returns up to ten log entries with the word “JMX”.
*tail lines=10 returns the last ten log entries.
*When you use {full | tail | head} with large log files, include the-o file option to specify an output file. Writing a large number of log entries to the console may result in an out of memory errors.
For more information about the -o file option, see output.
*To avoid performance issues, do not specify a large number for lines when using with tail, search or regex.
Examples When Executing on Command Central
*The run-time component with ID “OSGI-SPM” is managed by the Platform Manager registered as “is-dev”. The run-time component has a log with ID “default.log”. Use the following command to filter the log to entries that contain “JMX” as a word or part of a word, and return up to 20 matching entries. The results are written to the console.
sagcc get diagnostics logs is-dev OSGI-SPM default.log tail lines=20 
regex=.*JMX.*
*The run-time component with ID “OSGI-SPM” is managed by the Platform Manager registered as “is-dev”. The run-time component has a log with ID “default.log”. Use the following command to filter the log to entries that contain the word “JMX”, and return up to 20 matching entries. The results are written to the console.
sagcc get diagnostics logs is-dev OSGI-SPM default.log head lines=20 
search=JMX --password secret
Because the {--username | -u} option is not specified, the command uses the default user name. For more information, see username. The command specifies “secret” for the user’s password.
Examples When Executing on Platform Manager
*The run-time component with ID “OSGI-SPM” is managed by the Platform Manager with host name “rubicon2” and port “8092”. The run-time component has a log with ID “default.log”. Use the following command to filter the log to entries that contain “JMX” as a word or part of a word, and return up to 20 matching entries. The results are written to the console.
sagcc get diagnostics logs OSGI-SPM default.log tail lines=20 
regex=.*JMX.* --server http://rubicon2:8092/spm --password secret
*The run-time component with ID “OSGI-SPM” is managed by the Platform Manager with host name “rubicon2” and port “8092”. The run-time component has a log with ID “default.log”. Use the following command to filter the log to entries that contain the word “JMX”, and return up to 20 matching entries. The results are written to the console.
sagcc get diagnostics logs OSGI-SPM default.log head lines=20 
search=JMX --server http://rubicon2:8092/spm --password secret
Because the {--username | -u} option is not specified, the command uses the default user name. For more information, see username. The command specifies “secret” for the user’s password.