Skip to content

add -sum-field option - #6

Open
satta wants to merge 4 commits into
masterfrom
sum-fields
Open

add -sum-field option#6
satta wants to merge 4 commits into
masterfrom
sum-fields

Conversation

@satta

@satta satta commented Jul 17, 2026

Copy link
Copy Markdown
Member

This PR adds a CLI option to add a derived named field to the output, summing all the numeric values of all fields matching a given regex, e.g.

$ sudo ./ethflux -sum-field 'rx_packets=rx_[ubm]cast_packets' S1 | tr ',' '\n'  | grep rx_packets=
rx_packets=1264888403

to sum up received packets across all single entries

$ sudo ethflux S1 | tr ',' '\n' | grep packe
[0]:\ rx_bcast_packets=16
[0]:\ rx_mcast_packets=188788
[0]:\ rx_ucast_packets=128654675
[0]:\ tpa_packets=0
[0]:\ tx_bcast_packets=0
[0]:\ tx_mcast_packets=0
[0]:\ tx_ucast_packets=0
[1]:\ rx_bcast_packets=0
[1]:\ rx_mcast_packets=0
[1]:\ rx_ucast_packets=128320627
[1]:\ tpa_packets=0
[1]:\ tx_bcast_packets=0
[1]:\ tx_mcast_packets=0
[1]:\ tx_ucast_packets=0
[2]:\ rx_bcast_packets=0
[2]:\ rx_mcast_packets=0
[2]:\ rx_ucast_packets=128091371
...

@satta satta changed the title add -sum-fields option add -sum-field option Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant