Skip to content

Commit

Permalink
feat: linux/example - Capture TOP 10 processes from the system (#525)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmrfzn authored Oct 23, 2024
1 parent 7c3db0a commit a4c6f4e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions examples/linux/linux-top10-process.yml
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

0 comments on commit a4c6f4e

Please sign in to comment.