File

The purpose of the File Monitor is to:

  • check the presence of a log or flat file
  • monitor the file size, its growth percentage and growth speed
  • indicate when the file was last modified
  • parse the content of the file.

Monitoring Studio X only needs the path to the file to be monitored to start collecting information. The file path can contain the wildcards and macros below:

  • ? wildcard to match with exactly one character (e.g.: errorLog.??? will match with errorLog.001, errorLog.020, etc.)
  • * wildcard to match with any sequence of characters (e.g.: system-*.log will match with system-MYHOSTNAME.log)
  • %{TIME:...} followed by the expected date and time format, that will be replaced at run-time with the current date and time (e.g.: %{TIME:%Y-%m-%D}). Refer to Date and Time Formats for Macros for more details.
  • Environment variables like %SystemRoot% on Windows or $HOME on Linux and UNIX

Depending on your environment, you may also have to provide Monitoring Studio X with the credentials required to access the file.

You can parse and analyze the content of the file through a wide range of tools (Dynamic Object, Numeric Value Extraction, Text Pre-Processing, String Search, and Value Map). The most typical usage of file monitoring is parsing a log file and be informed when a specific string or numeric value is found.

Refer to the table below to know how to configure the File Monitor:

Property Description
File Path Path and name of the file to be monitored.
Credentials Used to Read the File Credentials required to access and read the file. By default, System Credentials are used.
File Read Mode Select LOG if only new content should be read, or FLAT if the whole file should be read at every collect.
Display Name Name to identify the File Monitor instance in TrueSight Operations Management.
Internal ID ID to be used to store the File Monitor configuration in the PATROL Agent configuration. This Internal ID is automatically generated based on the Display Name provided but can be edited if needed.
Collect Schedule How often new data is collected. A new collect can be performed from once every second, to once in a day. By default, the collect schedule is set to 2 minutes.
Timeout After Time in seconds after which the File collector will be stopped (Default: 30 seconds). When a timeout is reached, an error is reported in the Template's Collection Error Count parameter.

At this time, you can run the Dry Run feature to simulate the execution of this Monitor on a specific host and therefore verify that the output is conform to the expected result.

For log files, the Result parameter will remain empty until new content is added to the file.

Refer to:

No results.