Skip to content

Commit 8b58834

Browse files
updating readme
Signed-off-by: rakibhossainctr <[email protected]>
1 parent da17ecd commit 8b58834

File tree

1 file changed

+1
-20
lines changed

1 file changed

+1
-20
lines changed

README.md

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -203,24 +203,6 @@ spec:
203203

204204
```
205205

206-
Example of configuring a check to monitor only the most recently modified log file when multiple files match the pattern (useful for log rotation scenarios):
207-
208-
```yml
209-
---
210-
type: CheckConfig
211-
api_version: core/v2
212-
metadata:
213-
name: sensu-check-log-latest
214-
spec:
215-
command: sensu-check-log -p /var/log/ -e "application.*\.log$" -m "(?i)error" -d /tmp/sensu-check-latest-log/ --use-latest-mtime
216-
stdin: true
217-
runtime_assets:
218-
- sensu/sensu-check-log
219-
220-
```
221-
222-
223-
224206
## Installation from source
225207

226208
The preferred way of installing and deploying this plugin is to use it as an Asset. If you would
@@ -237,14 +219,13 @@ go build
237219

238220
### File Selection with Modification Time
239221

240-
When using the `--log-file-expr` option with wildcard patterns, multiple log files may match the expression. By default, all matching files are monitored. However, you can use the `--use-latest-mtime` flag to monitor only the file with the most recent modification time.
222+
When using the `--log-file-expr` option with wildcard patterns, multiple log files may match the expression. By default, all matching files are monitored. However, you can use the `--mtime` flag to monitor only the file with the most recent modification time.
241223

242224
This feature is particularly useful in log rotation scenarios where:
243225
- Log files are rotated with timestamps (e.g., `app.log`, `app.log.1`, `app.log.2`)
244226
- You want to monitor only the actively written log file
245227
- Multiple log files exist but only the newest is relevant
246228

247-
The modification time comparison helps ensure that you're always monitoring the most current log file, similar to the `CompareByLastUpdate` feature found in other log monitoring tools.
248229

249230
## Contributing
250231

0 commit comments

Comments
 (0)