Save messages to a file
- Last UpdatedJan 13, 2023
- 1 minute read
- PI System
- PI Server
Use the -of option with pigetmsg to write messages to a file. For example, the following command writes messages from the last seven days to a log file:
pigetmsg -st *-7d -of
By default, the utility automatically names the file based on the search start and end time, the name of the server, and any filtering options you specify. You can specify a file name:
pigetmsg -st * -1d -et* -of mylogs.dat
By default, the utility writes message in log-file format, which you can search and filter with PI SMT or pigetmsg. You can specify alternative formats, including CSV, XML, wide (one message per line), and two line (two lines per message).