Metricpass on multiple metrics at once

Hello all

let’s say i have multiple metrics to filters depending of the value

this work for one metric

[[inputs.win_perf_counters]]
    metricpass = "fields.IO_Other_Bytes_persec > 0"

i tested different way, but it seems it don’t work.

[[inputs.win_perf_counters]]
    metricpass = "fields.IO_Other_Bytes_persec > 0","fields.IO_Read_Bytes_persec >0"

[[inputs.win_perf_counters]]
  metricpass = [
	"fields.IO_Data_Bytes_persec > 0",
	"fields.IO_Other_Bytes_persec > 0",
	"fields.IO_Read_Bytes_persec >0",
	"fields.IO_Write_Bytes_persec >0",
  ]	

Any suggestions?
regards
p.s.: it’s a derivateds question from this topics that is now resolved Do not send/ignore measurement if Value is Zero

How about the “logic” way of connecting your expression using a logical or?

[[inputs.win_perf_counters]]
  metricpass = 'fields.IO_Data_Bytes_persec > 0 || fields.IO_Other_Bytes_persec > 0 || fields.IO_Read_Bytes_persec >0 || fields.IO_Write_Bytes_persec >0'

Hi Srebhan

Thanks you, that definitively work.

1 Like

Hello Srebhan

sorry i was too enthusiaste, there is still some data with value =0 that are passed.

win_proc,host=PARX53005503,instance=npullvpsx,objectname=Process Private_Bytes=19591168,IO_Data_Bytes_persec=0,IO_READ_Bytes_persec=0,IO_Other_Bytes_persec=12.807184446258,IO_Write_Bytes_persec=0,Percent_processor_Time=0,Handle_Count=1567,Working_Set=21237760

Any suggestion?

:slight_smile: Thanks