-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: linux/example - Capture TOP 10 processes from the system (#525)
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This is will capture the TOP 10 processes from the system | ||
# | ||
# Query the events : `FROM filteredProcessSample SELECT *` | ||
# | ||
# NOTE: Events-to-Metrics can be configured to push the specific events (memory and/or cpu) to metrics dimension | ||
integrations: | ||
- name: nri-flex | ||
# interval: 30s | ||
config: | ||
name: linuxProcessFiltered | ||
apis: | ||
- name: filteredProcess | ||
commands: | ||
- run: ps -eo pid,ppid,time,euser,cmd,%mem,%cpu --sort -%mem | head -n10 | ||
split: horizontal | ||
set_header: [processID, parentID, time, userName, commandLine,memory,cpu] | ||
regex_match: true | ||
split_by: (\d+)\s+(\d+)\s+(\d{2,3}:\d{2}:\d{2})\s+(\S+)\s+(.+?)\s+(\d+\.\d+)\s+(\d+\.\d+)$ | ||
custom_attributes: | ||
processFilter: top10Processes | ||
hostname: localhost |