Filter by metric value

smnp
telegraf
#1

I’ve run across a situation building a looking glass where it would be helpful to be able to drop whole messages where certain metric values are present (in this case, where both metrics we are polling are zero).

While polling ifXTable for counters from switches, obviously we don’t want a bunch of ports that are unused/unplugged to be spamming up our database with zero values. My quick workaround for this was to plumb a GELF output from telegraf to logstash, using the config seen over here…

Saved me huge amounts of space, but it would be nice to be able to do this right in telegraf to eliminate the middle layer of logstash.

#2

Can you run snmpwalk against your agent? Here is how I do it on my snmpd instance:

snmpwalk -v1 -cpublic localhost IF-MIB::ifXTable
#3

Another way to do this would be to run Kapacitor on the same host that Telegraf is running on. Then have Telegraf send to Kapacitor, which can then filter based on arbitrary rules defined in TICKscript then forward onto InfluxDB. The other nice advantage to this is that it enables you to do monitoring and alerting at the edge.

#4

Can I use Kapacitor with Elasticsearch? I am using Telegraf for the portion I’m wanting to filter (SNMP fetches), but we cannot use InfluxDB due to huge amounts of Netflow data, which will overwhelm InfluxDB with short series and bring it to a grinding halt. Not wanting to run two different DBs as we already have a lot of moving parts to this and the list is only getting longer.

I haven’t found any documentation for using Kapacitor directly with Telegraf and feeding its data back to Telegraf to be written in Elasticsearch. Have any links to any that my googling/browsing hasn’t found?

#5

Sorry for the late reply…sanitized (truncated) data follows.

IF-MIB::ifHCInOctets.1000 = Counter64: 21837075
IF-MIB::ifHCInOctets.1001 = Counter64: 0
IF-MIB::ifHCInOctets.1002 = Counter64: 0
IF-MIB::ifHCInOctets.1003 = Counter64: 9449731206090
IF-MIB::ifHCInOctets.1004 = Counter64: 1419106708
IF-MIB::ifHCInOctets.1005 = Counter64: 0
IF-MIB::ifHCInOctets.1006 = Counter64: 90604238591144
IF-MIB::ifHCInOctets.1007 = Counter64: 419264000360
IF-MIB::ifHCInOctets.1008 = Counter64: 20195615
IF-MIB::ifHCInOctets.1009 = Counter64: 890625397569
IF-MIB::ifHCInOctets.1010 = Counter64: 14054187
IF-MIB::ifHCInOctets.1011 = Counter64: 104525382369
IF-MIB::ifHCInOctets.1012 = Counter64: 110114018376
IF-MIB::ifHCInOctets.1013 = Counter64: 109745721493
IF-MIB::ifHCInOctets.1014 = Counter64: 126858201055
IF-MIB::ifHCInOctets.1015 = Counter64: 348582273342
IF-MIB::ifHCInOctets.1016 = Counter64: 107665996170
IF-MIB::ifHCInOctets.1017 = Counter64: 108353271758
IF-MIB::ifHCInOctets.1018 = Counter64: 110814789270
IF-MIB::ifHCInOctets.1019 = Counter64: 26335244542913
IF-MIB::ifHCInOctets.1020 = Counter64: 222647224100
IF-MIB::ifHCInOctets.1021 = Counter64: 0
IF-MIB::ifHCInOctets.1022 = Counter64: 0
IF-MIB::ifHCInOctets.1023 = Counter64: 0
IF-MIB::ifHCInOctets.1024 = Counter64: 0
IF-MIB::ifHCInOctets.1025 = Counter64: 1492336578
IF-MIB::ifHCInOctets.1026 = Counter64: 1508412659
IF-MIB::ifHCInOctets.1027 = Counter64: 0
IF-MIB::ifHCInOctets.1028 = Counter64: 0
IF-MIB::ifHCInOctets.2001 = Counter64: 1350664548
IF-MIB::ifHCInOctets.2002 = Counter64: 57091096299944
IF-MIB::ifHCInOctets.2003 = Counter64: 1827868700921
IF-MIB::ifHCInOctets.2004 = Counter64: 1994052321
IF-MIB::ifHCInOctets.2005 = Counter64: 125680244986
IF-MIB::ifHCInOctets.2006 = Counter64: 0
IF-MIB::ifHCInOctets.2007 = Counter64: 0
IF-MIB::ifHCInOctets.2008 = Counter64: 0
IF-MIB::ifHCInOctets.2009 = Counter64: 23560
IF-MIB::ifHCInOctets.2010 = Counter64: 0
IF-MIB::ifHCInOctets.2011 = Counter64: 9863945697582
IF-MIB::ifHCInOctets.2012 = Counter64: 80203243882512
IF-MIB::ifHCInOctets.2013 = Counter64: 0
IF-MIB::ifHCInOctets.2014 = Counter64: 3012019777147
IF-MIB::ifHCInOctets.2015 = Counter64: 35643973987128
IF-MIB::ifHCInOctets.2016 = Counter64: 0
IF-MIB::ifHCInOctets.2017 = Counter64: 0
IF-MIB::ifHCInOctets.2018 = Counter64: 3018260328481
IF-MIB::ifHCInOctets.2019 = Counter64: 18542178635
IF-MIB::ifHCInOctets.2020 = Counter64: 0
IF-MIB::ifHCInOctets.2021 = Counter64: 0
IF-MIB::ifHCInOctets.2022 = Counter64: 0
IF-MIB::ifHCInOctets.2023 = Counter64: 0
IF-MIB::ifHCInOctets.2024 = Counter64: 0
IF-MIB::ifHCInOctets.2025 = Counter64: 0
IF-MIB::ifHCInOctets.2026 = Counter64: 0
IF-MIB::ifHCInOctets.2027 = Counter64: 0
IF-MIB::ifHCInOctets.2028 = Counter64: 0
IF-MIB::ifHCInOctets.1000001 = Counter64: 0
IF-MIB::ifHCInOctets.1000002 = Counter64: 0
IF-MIB::ifHCInOctets.1000003 = Counter64: 0
IF-MIB::ifHCInOctets.1000004 = Counter64: 0
IF-MIB::ifHCInOctets.1000005 = Counter64: 0
IF-MIB::ifHCInOctets.1000006 = Counter64: 0
IF-MIB::ifHCInOctets.1000007 = Counter64: 0
IF-MIB::ifHCInOctets.1000008 = Counter64: 0
IF-MIB::ifHCInOctets.1000009 = Counter64: 0
IF-MIB::ifHCInOctets.1000010 = Counter64: 0
IF-MIB::ifHCInOctets.1000011 = Counter64: 0
IF-MIB::ifHCInOctets.1000012 = Counter64: 0
IF-MIB::ifHCInOctets.1000013 = Counter64: 0
IF-MIB::ifHCInOctets.1000014 = Counter64: 0
IF-MIB::ifHCInOctets.1000015 = Counter64: 0
IF-MIB::ifHCInOctets.1000016 = Counter64: 0
IF-MIB::ifHCInOctets.1000017 = Counter64: 0
IF-MIB::ifHCInOctets.1000018 = Counter64: 0
IF-MIB::ifHCInOctets.1000019 = Counter64: 0
IF-MIB::ifHCInOctets.1000020 = Counter64: 0
IF-MIB::ifHCInOctets.1000021 = Counter64: 0
IF-MIB::ifHCInOctets.1000022 = Counter64: 0
IF-MIB::ifHCInOctets.1000023 = Counter64: 0
IF-MIB::ifHCInOctets.1000024 = Counter64: 0
IF-MIB::ifHCInOctets.1000025 = Counter64: 0
IF-MIB::ifHCInOctets.1000026 = Counter64: 0
IF-MIB::ifHCInOctets.1000027 = Counter64: 0
IF-MIB::ifHCInOctets.1000028 = Counter64: 0
IF-MIB::ifHCInOctets.1000029 = Counter64: 0
IF-MIB::ifHCInOctets.1000030 = Counter64: 0
IF-MIB::ifHCInOctets.1000031 = Counter64: 0
IF-MIB::ifHCInOctets.1000032 = Counter64: 0
IF-MIB::ifHCInOctets.1000033 = Counter64: 0
IF-MIB::ifHCInOctets.1000034 = Counter64: 0
IF-MIB::ifHCInOctets.1000035 = Counter64: 0
IF-MIB::ifHCInOctets.1000036 = Counter64: 0
IF-MIB::ifHCInOctets.1000037 = Counter64: 0
IF-MIB::ifHCInOctets.1000038 = Counter64: 0
IF-MIB::ifHCInOctets.1000039 = Counter64: 0
IF-MIB::ifHCInOctets.1000040 = Counter64: 0
IF-MIB::ifHCInOctets.1000041 = Counter64: 0
IF-MIB::ifHCInOctets.1000042 = Counter64: 0
IF-MIB::ifHCInOctets.1000043 = Counter64: 0
IF-MIB::ifHCInOctets.1000044 = Counter64: 0
IF-MIB::ifHCInOctets.1000045 = Counter64: 0
IF-MIB::ifHCInOctets.1000046 = Counter64: 0
IF-MIB::ifHCInOctets.1000047 = Counter64: 0
IF-MIB::ifHCInOctets.1000048 = Counter64: 0
IF-MIB::ifHCInOctets.1000049 = Counter64: 0
IF-MIB::ifHCInOctets.1000050 = Counter64: 0
IF-MIB::ifHCInOctets.1000051 = Counter64: 0
IF-MIB::ifHCInOctets.1000052 = Counter64: 0
IF-MIB::ifHCInOctets.1000053 = Counter64: 0
IF-MIB::ifHCInOctets.1000054 = Counter64: 0
IF-MIB::ifHCInOctets.1000055 = Counter64: 0
IF-MIB::ifHCInOctets.1000056 = Counter64: 0
IF-MIB::ifHCInOctets.1000057 = Counter64: 0
IF-MIB::ifHCInOctets.1000058 = Counter64: 0
IF-MIB::ifHCInOctets.1000059 = Counter64: 0
IF-MIB::ifHCInOctets.1000060 = Counter64: 0
IF-MIB::ifHCInOctets.1000061 = Counter64: 0
IF-MIB::ifHCInOctets.1000062 = Counter64: 0
IF-MIB::ifHCInOctets.1000063 = Counter64: 0
IF-MIB::ifHCInOctets.1000065 = Counter64: 0
IF-MIB::ifHCInOctets.1000066 = Counter64: 0
IF-MIB::ifHCInOctets.1000067 = Counter64: 0
IF-MIB::ifHCInOctets.1000068 = Counter64: 0
IF-MIB::ifHCInOctets.1000069 = Counter64: 0
IF-MIB::ifHCInOctets.1000070 = Counter64: 0
IF-MIB::ifHCInOctets.1000071 = Counter64: 0
IF-MIB::ifHCInOctets.1000072 = Counter64: 0
IF-MIB::ifHCInOctets.1000073 = Counter64: 0
IF-MIB::ifHCInOctets.1000074 = Counter64: 0
IF-MIB::ifHCInOctets.1000075 = Counter64: 0
IF-MIB::ifHCInOctets.1000076 = Counter64: 0
IF-MIB::ifHCInOctets.1000077 = Counter64: 0
IF-MIB::ifHCInOctets.1000078 = Counter64: 0
IF-MIB::ifHCInOctets.1000079 = Counter64: 0
IF-MIB::ifHCInOctets.1000080 = Counter64: 0
IF-MIB::ifHCInOctets.1000081 = Counter64: 0
IF-MIB::ifHCInOctets.1000082 = Counter64: 0
IF-MIB::ifHCInOctets.1000083 = Counter64: 0
IF-MIB::ifHCInOctets.1000084 = Counter64: 0
IF-MIB::ifHCInOctets.1000085 = Counter64: 0
IF-MIB::ifHCInOctets.1000086 = Counter64: 0
IF-MIB::ifHCInOctets.1000087 = Counter64: 0
IF-MIB::ifHCInOctets.1000088 = Counter64: 0
IF-MIB::ifHCInOctets.1000089 = Counter64: 0
IF-MIB::ifHCInOctets.1000091 = Counter64: 0
IF-MIB::ifHCInOctets.1000092 = Counter64: 0
IF-MIB::ifHCInOctets.1000093 = Counter64: 0
IF-MIB::ifHCInOctets.1000094 = Counter64: 0
IF-MIB::ifHCInOctets.1000095 = Counter64: 0
IF-MIB::ifHCInOctets.1000096 = Counter64: 0
IF-MIB::ifHCInOctets.1000097 = Counter64: 0
IF-MIB::ifHCInOctets.1000098 = Counter64: 0
IF-MIB::ifHCInOctets.1000099 = Counter64: 0
IF-MIB::ifHCInOctets.1000100 = Counter64: 0
IF-MIB::ifHCInOctets.1000101 = Counter64: 0
IF-MIB::ifHCInOctets.1000102 = Counter64: 0
IF-MIB::ifHCInOctets.1000103 = Counter64: 0
IF-MIB::ifHCInOctets.1000104 = Counter64: 0
IF-MIB::ifHCInOctets.1000105 = Counter64: 0
IF-MIB::ifHCInOctets.1000106 = Counter64: 0
IF-MIB::ifHCInOctets.1000107 = Counter64: 0
IF-MIB::ifHCInOctets.1000108 = Counter64: 0
IF-MIB::ifHCInOctets.1000109 = Counter64: 0
IF-MIB::ifHCInOctets.1000110 = Counter64: 0
IF-MIB::ifHCInOctets.1000111 = Counter64: 0
IF-MIB::ifHCInOctets.1000112 = Counter64: 0
IF-MIB::ifHCInOctets.1000113 = Counter64: 0
IF-MIB::ifHCInOctets.1000114 = Counter64: 0
IF-MIB::ifHCInOctets.1000115 = Counter64: 0
IF-MIB::ifHCInOctets.1000116 = Counter64: 0
IF-MIB::ifHCInOctets.1000117 = Counter64: 0
IF-MIB::ifHCInOctets.1000118 = Counter64: 0
IF-MIB::ifHCInOctets.1000119 = Counter64: 0
IF-MIB::ifHCInOctets.1000120 = Counter64: 0
IF-MIB::ifHCInOctets.1000121 = Counter64: 0
IF-MIB::ifHCInOctets.1000122 = Counter64: 0
IF-MIB::ifHCInOctets.1000123 = Counter64: 0
IF-MIB::ifHCInOctets.1000124 = Counter64: 0
IF-MIB::ifHCInOctets.1000125 = Counter64: 0
IF-MIB::ifHCInOctets.1000126 = Counter64: 0
IF-MIB::ifHCInOctets.1000127 = Counter64: 0
IF-MIB::ifHCInOctets.1000128 = Counter64: 0
IF-MIB::ifHCInOctets.1000130 = Counter64: 0
IF-MIB::ifHCInOctets.1000131 = Counter64: 0
IF-MIB::ifHCInOctets.1000132 = Counter64: 0
IF-MIB::ifHCInOctets.1000133 = Counter64: 0
IF-MIB::ifHCInOctets.1000134 = Counter64: 0
IF-MIB::ifHCInOctets.1000135 = Counter64: 0
IF-MIB::ifHCInOctets.1000136 = Counter64: 0
IF-MIB::ifHCInOctets.1000137 = Counter64: 0
IF-MIB::ifHCInOctets.1000138 = Counter64: 0
IF-MIB::ifHCInOctets.1000139 = Counter64: 0
IF-MIB::ifHCInOctets.1000140 = Counter64: 0
IF-MIB::ifHCInOctets.1000141 = Counter64: 0
IF-MIB::ifHCInOctets.1000142 = Counter64: 0
IF-MIB::ifHCInOctets.1000143 = Counter64: 0
IF-MIB::ifHCInOctets.1000144 = Counter64: 0
IF-MIB::ifHCInOctets.1000145 = Counter64: 0
IF-MIB::ifHCInOctets.1000146 = Counter64: 0
IF-MIB::ifHCInOctets.1000147 = Counter64: 0
IF-MIB::ifHCInOctets.1000148 = Counter64: 0
IF-MIB::ifHCInOctets.1000149 = Counter64: 0
IF-MIB::ifHCInOctets.1000150 = Counter64: 0
IF-MIB::ifHCInOctets.1000151 = Counter64: 0
IF-MIB::ifHCInOctets.1000152 = Counter64: 0
IF-MIB::ifHCInOctets.1000153 = Counter64: 0
IF-MIB::ifHCInOctets.1000154 = Counter64: 0
IF-MIB::ifHCInOctets.1000155 = Counter64: 0
IF-MIB::ifHCInOctets.1000156 = Counter64: 0
IF-MIB::ifHCInOctets.1000157 = Counter64: 0
IF-MIB::ifHCInOctets.1000158 = Counter64: 0
IF-MIB::ifHCInOctets.1000159 = Counter64: 0
IF-MIB::ifHCInOctets.1000160 = Counter64: 0
IF-MIB::ifHCInOctets.1000161 = Counter64: 0
IF-MIB::ifHCInOctets.1000162 = Counter64: 0
IF-MIB::ifHCInOctets.1000163 = Counter64: 0
IF-MIB::ifHCInOctets.1000164 = Counter64: 0
IF-MIB::ifHCInOctets.1000165 = Counter64: 0
IF-MIB::ifHCInOctets.1000166 = Counter64: 0
IF-MIB::ifHCInOctets.1000167 = Counter64: 0
IF-MIB::ifHCInOctets.1000168 = Counter64: 0
IF-MIB::ifHCInOctets.1000169 = Counter64: 0
IF-MIB::ifHCInOctets.1000170 = Counter64: 0
IF-MIB::ifHCInOctets.1000171 = Counter64: 0
IF-MIB::ifHCInOctets.1000172 = Counter64: 0
IF-MIB::ifHCInOctets.1000173 = Counter64: 0
IF-MIB::ifHCInOctets.1000174 = Counter64: 0
IF-MIB::ifHCInOctets.1000175 = Counter64: 0
IF-MIB::ifHCInOctets.1000176 = Counter64: 0
IF-MIB::ifHCInOctets.1000177 = Counter64: 0
IF-MIB::ifHCInOctets.1000178 = Counter64: 0
IF-MIB::ifHCInOctets.1000179 = Counter64: 0
IF-MIB::ifHCInOctets.1000181 = Counter64: 0
IF-MIB::ifHCInOctets.1000183 = Counter64: 0
IF-MIB::ifHCInOctets.1000184 = Counter64: 0
IF-MIB::ifHCInOctets.1000185 = Counter64: 0
IF-MIB::ifHCInOctets.1000186 = Counter64: 0
IF-MIB::ifHCInOctets.1000187 = Counter64: 0
IF-MIB::ifHCInOctets.1000188 = Counter64: 0
IF-MIB::ifHCInOctets.1000189 = Counter64: 0
IF-MIB::ifHCInOctets.1000190 = Counter64: 0
IF-MIB::ifHCInOctets.1000191 = Counter64: 0
IF-MIB::ifHCInOctets.1000192 = Counter64: 0
IF-MIB::ifHCInOctets.1000193 = Counter64: 0
IF-MIB::ifHCInOctets.1000194 = Counter64: 0
IF-MIB::ifHCInOctets.1000195 = Counter64: 0
IF-MIB::ifHCInOctets.1000196 = Counter64: 0
IF-MIB::ifHCInOctets.1000198 = Counter64: 0
IF-MIB::ifHCInOctets.1000199 = Counter64: 0
IF-MIB::ifHCInOctets.1000201 = Counter64: 0
... ... ... ... ... ... ... ... ... ...
IF-MIB::ifHCOutOctets.1000 = Counter64: 54879921
IF-MIB::ifHCOutOctets.1001 = Counter64: 0
IF-MIB::ifHCOutOctets.1002 = Counter64: 0
IF-MIB::ifHCOutOctets.1003 = Counter64: 12960036367473
IF-MIB::ifHCOutOctets.1004 = Counter64: 5462854084
IF-MIB::ifHCOutOctets.1005 = Counter64: 12023694
IF-MIB::ifHCOutOctets.1006 = Counter64: 26277357050503
IF-MIB::ifHCOutOctets.1007 = Counter64: 885442762164
IF-MIB::ifHCOutOctets.1008 = Counter64: 112043184
IF-MIB::ifHCOutOctets.1009 = Counter64: 1491833915055
IF-MIB::ifHCOutOctets.1010 = Counter64: 175212770
IF-MIB::ifHCOutOctets.1011 = Counter64: 32854434974
IF-MIB::ifHCOutOctets.1012 = Counter64: 33361495169
IF-MIB::ifHCOutOctets.1013 = Counter64: 32933671487
IF-MIB::ifHCOutOctets.1014 = Counter64: 37896848804
IF-MIB::ifHCOutOctets.1015 = Counter64: 1621742383022
IF-MIB::ifHCOutOctets.1016 = Counter64: 31748100378
IF-MIB::ifHCOutOctets.1017 = Counter64: 33099702772
IF-MIB::ifHCOutOctets.1018 = Counter64: 33889485322
IF-MIB::ifHCOutOctets.1019 = Counter64: 97067636273501
IF-MIB::ifHCOutOctets.1020 = Counter64: 32719686792
IF-MIB::ifHCOutOctets.1021 = Counter64: 0
IF-MIB::ifHCOutOctets.1022 = Counter64: 0
IF-MIB::ifHCOutOctets.1023 = Counter64: 0
IF-MIB::ifHCOutOctets.1024 = Counter64: 0
IF-MIB::ifHCOutOctets.1025 = Counter64: 209913819216
IF-MIB::ifHCOutOctets.1026 = Counter64: 1563441743
IF-MIB::ifHCOutOctets.1027 = Counter64: 0
IF-MIB::ifHCOutOctets.1028 = Counter64: 0
IF-MIB::ifHCOutOctets.2001 = Counter64: 3838932736
IF-MIB::ifHCOutOctets.2002 = Counter64: 133638462954878
IF-MIB::ifHCOutOctets.2003 = Counter64: 684878793712
IF-MIB::ifHCOutOctets.2004 = Counter64: 2321878597
IF-MIB::ifHCOutOctets.2005 = Counter64: 290558542
IF-MIB::ifHCOutOctets.2006 = Counter64: 0
IF-MIB::ifHCOutOctets.2007 = Counter64: 0
IF-MIB::ifHCOutOctets.2008 = Counter64: 564568507
IF-MIB::ifHCOutOctets.2009 = Counter64: 11823282
IF-MIB::ifHCOutOctets.2010 = Counter64: 0
IF-MIB::ifHCOutOctets.2011 = Counter64: 1778005833970
IF-MIB::ifHCOutOctets.2012 = Counter64: 16843260929402
IF-MIB::ifHCOutOctets.2013 = Counter64: 12445722
IF-MIB::ifHCOutOctets.2014 = Counter64: 402338561618
IF-MIB::ifHCOutOctets.2015 = Counter64: 4544651593380
IF-MIB::ifHCOutOctets.2016 = Counter64: 12230946
IF-MIB::ifHCOutOctets.2017 = Counter64: 0
IF-MIB::ifHCOutOctets.2018 = Counter64: 21373702399079
IF-MIB::ifHCOutOctets.2019 = Counter64: 15312014718
IF-MIB::ifHCOutOctets.2020 = Counter64: 12023694
IF-MIB::ifHCOutOctets.2021 = Counter64: 0
IF-MIB::ifHCOutOctets.2022 = Counter64: 0
IF-MIB::ifHCOutOctets.2023 = Counter64: 0
IF-MIB::ifHCOutOctets.2024 = Counter64: 0
IF-MIB::ifHCOutOctets.2025 = Counter64: 0
IF-MIB::ifHCOutOctets.2026 = Counter64: 0
IF-MIB::ifHCOutOctets.2027 = Counter64: 0
IF-MIB::ifHCOutOctets.2028 = Counter64: 0
IF-MIB::ifHCOutOctets.1000001 = Counter64: 0
IF-MIB::ifHCOutOctets.1000002 = Counter64: 0
IF-MIB::ifHCOutOctets.1000003 = Counter64: 0
IF-MIB::ifHCOutOctets.1000004 = Counter64: 0
IF-MIB::ifHCOutOctets.1000005 = Counter64: 0
IF-MIB::ifHCOutOctets.1000006 = Counter64: 0
IF-MIB::ifHCOutOctets.1000007 = Counter64: 0
IF-MIB::ifHCOutOctets.1000008 = Counter64: 0
IF-MIB::ifHCOutOctets.1000009 = Counter64: 0
IF-MIB::ifHCOutOctets.1000010 = Counter64: 0
IF-MIB::ifHCOutOctets.1000011 = Counter64: 0
IF-MIB::ifHCOutOctets.1000012 = Counter64: 0
IF-MIB::ifHCOutOctets.1000013 = Counter64: 0
IF-MIB::ifHCOutOctets.1000014 = Counter64: 0
IF-MIB::ifHCOutOctets.1000015 = Counter64: 0
IF-MIB::ifHCOutOctets.1000016 = Counter64: 0
IF-MIB::ifHCOutOctets.1000017 = Counter64: 0
IF-MIB::ifHCOutOctets.1000018 = Counter64: 0
IF-MIB::ifHCOutOctets.1000019 = Counter64: 0
IF-MIB::ifHCOutOctets.1000020 = Counter64: 0
IF-MIB::ifHCOutOctets.1000021 = Counter64: 0
IF-MIB::ifHCOutOctets.1000022 = Counter64: 0
IF-MIB::ifHCOutOctets.1000023 = Counter64: 0
IF-MIB::ifHCOutOctets.1000024 = Counter64: 0
IF-MIB::ifHCOutOctets.1000025 = Counter64: 0
IF-MIB::ifHCOutOctets.1000026 = Counter64: 0
IF-MIB::ifHCOutOctets.1000027 = Counter64: 0
IF-MIB::ifHCOutOctets.1000028 = Counter64: 0
IF-MIB::ifHCOutOctets.1000029 = Counter64: 0
IF-MIB::ifHCOutOctets.1000030 = Counter64: 0
IF-MIB::ifHCOutOctets.1000031 = Counter64: 0
IF-MIB::ifHCOutOctets.1000032 = Counter64: 0
IF-MIB::ifHCOutOctets.1000033 = Counter64: 0
IF-MIB::ifHCOutOctets.1000034 = Counter64: 0
IF-MIB::ifHCOutOctets.1000035 = Counter64: 0
IF-MIB::ifHCOutOctets.1000036 = Counter64: 0
IF-MIB::ifHCOutOctets.1000037 = Counter64: 0
IF-MIB::ifHCOutOctets.1000038 = Counter64: 0
IF-MIB::ifHCOutOctets.1000039 = Counter64: 0
IF-MIB::ifHCOutOctets.1000040 = Counter64: 0
IF-MIB::ifHCOutOctets.1000041 = Counter64: 0
IF-MIB::ifHCOutOctets.1000042 = Counter64: 0
IF-MIB::ifHCOutOctets.1000043 = Counter64: 0
IF-MIB::ifHCOutOctets.1000044 = Counter64: 0
IF-MIB::ifHCOutOctets.1000045 = Counter64: 0
IF-MIB::ifHCOutOctets.1000046 = Counter64: 0
IF-MIB::ifHCOutOctets.1000047 = Counter64: 0
IF-MIB::ifHCOutOctets.1000048 = Counter64: 0
IF-MIB::ifHCOutOctets.1000049 = Counter64: 0
IF-MIB::ifHCOutOctets.1000050 = Counter64: 0
IF-MIB::ifHCOutOctets.1000051 = Counter64: 0
IF-MIB::ifHCOutOctets.1000052 = Counter64: 0
IF-MIB::ifHCOutOctets.1000053 = Counter64: 0
IF-MIB::ifHCOutOctets.1000054 = Counter64: 0
IF-MIB::ifHCOutOctets.1000055 = Counter64: 0
IF-MIB::ifHCOutOctets.1000056 = Counter64: 0
IF-MIB::ifHCOutOctets.1000057 = Counter64: 0
IF-MIB::ifHCOutOctets.1000058 = Counter64: 0
IF-MIB::ifHCOutOctets.1000059 = Counter64: 0
IF-MIB::ifHCOutOctets.1000060 = Counter64: 0
IF-MIB::ifHCOutOctets.1000061 = Counter64: 0
IF-MIB::ifHCOutOctets.1000062 = Counter64: 0
IF-MIB::ifHCOutOctets.1000063 = Counter64: 0
IF-MIB::ifHCOutOctets.1000065 = Counter64: 0
IF-MIB::ifHCOutOctets.1000066 = Counter64: 0
IF-MIB::ifHCOutOctets.1000067 = Counter64: 0
IF-MIB::ifHCOutOctets.1000068 = Counter64: 0
IF-MIB::ifHCOutOctets.1000069 = Counter64: 0
IF-MIB::ifHCOutOctets.1000070 = Counter64: 0
IF-MIB::ifHCOutOctets.1000071 = Counter64: 0
IF-MIB::ifHCOutOctets.1000072 = Counter64: 0
IF-MIB::ifHCOutOctets.1000073 = Counter64: 0
IF-MIB::ifHCOutOctets.1000074 = Counter64: 0
IF-MIB::ifHCOutOctets.1000075 = Counter64: 0
IF-MIB::ifHCOutOctets.1000076 = Counter64: 0
IF-MIB::ifHCOutOctets.1000077 = Counter64: 0
IF-MIB::ifHCOutOctets.1000078 = Counter64: 0
IF-MIB::ifHCOutOctets.1000079 = Counter64: 0
IF-MIB::ifHCOutOctets.1000080 = Counter64: 0
IF-MIB::ifHCOutOctets.1000081 = Counter64: 0
IF-MIB::ifHCOutOctets.1000082 = Counter64: 0
IF-MIB::ifHCOutOctets.1000083 = Counter64: 0
IF-MIB::ifHCOutOctets.1000084 = Counter64: 0
IF-MIB::ifHCOutOctets.1000085 = Counter64: 0
IF-MIB::ifHCOutOctets.1000086 = Counter64: 0
IF-MIB::ifHCOutOctets.1000087 = Counter64: 0
IF-MIB::ifHCOutOctets.1000088 = Counter64: 0
IF-MIB::ifHCOutOctets.1000089 = Counter64: 0
IF-MIB::ifHCOutOctets.1000091 = Counter64: 0
IF-MIB::ifHCOutOctets.1000092 = Counter64: 0
IF-MIB::ifHCOutOctets.1000093 = Counter64: 0
IF-MIB::ifHCOutOctets.1000094 = Counter64: 0
IF-MIB::ifHCOutOctets.1000095 = Counter64: 0
IF-MIB::ifHCOutOctets.1000096 = Counter64: 0
IF-MIB::ifHCOutOctets.1000097 = Counter64: 0
IF-MIB::ifHCOutOctets.1000098 = Counter64: 0
IF-MIB::ifHCOutOctets.1000099 = Counter64: 0
IF-MIB::ifHCOutOctets.1000100 = Counter64: 0
IF-MIB::ifHCOutOctets.1000101 = Counter64: 0
IF-MIB::ifHCOutOctets.1000102 = Counter64: 0
IF-MIB::ifHCOutOctets.1000103 = Counter64: 0
IF-MIB::ifHCOutOctets.1000104 = Counter64: 0
IF-MIB::ifHCOutOctets.1000105 = Counter64: 0
IF-MIB::ifHCOutOctets.1000106 = Counter64: 0
IF-MIB::ifHCOutOctets.1000107 = Counter64: 0
IF-MIB::ifHCOutOctets.1000108 = Counter64: 0
IF-MIB::ifHCOutOctets.1000109 = Counter64: 0
IF-MIB::ifHCOutOctets.1000110 = Counter64: 0
IF-MIB::ifHCOutOctets.1000111 = Counter64: 0
IF-MIB::ifHCOutOctets.1000112 = Counter64: 0
IF-MIB::ifHCOutOctets.1000113 = Counter64: 0
IF-MIB::ifHCOutOctets.1000114 = Counter64: 0
IF-MIB::ifHCOutOctets.1000115 = Counter64: 0
IF-MIB::ifHCOutOctets.1000116 = Counter64: 0
IF-MIB::ifHCOutOctets.1000117 = Counter64: 0
IF-MIB::ifHCOutOctets.1000118 = Counter64: 0
IF-MIB::ifHCOutOctets.1000119 = Counter64: 0
IF-MIB::ifHCOutOctets.1000120 = Counter64: 0
IF-MIB::ifHCOutOctets.1000121 = Counter64: 0
IF-MIB::ifHCOutOctets.1000122 = Counter64: 0
IF-MIB::ifHCOutOctets.1000123 = Counter64: 0
IF-MIB::ifHCOutOctets.1000124 = Counter64: 0
IF-MIB::ifHCOutOctets.1000125 = Counter64: 0
IF-MIB::ifHCOutOctets.1000126 = Counter64: 0
IF-MIB::ifHCOutOctets.1000127 = Counter64: 0
IF-MIB::ifHCOutOctets.1000128 = Counter64: 0
IF-MIB::ifHCOutOctets.1000130 = Counter64: 0
IF-MIB::ifHCOutOctets.1000131 = Counter64: 0
IF-MIB::ifHCOutOctets.1000132 = Counter64: 0
IF-MIB::ifHCOutOctets.1000133 = Counter64: 0
IF-MIB::ifHCOutOctets.1000134 = Counter64: 0
IF-MIB::ifHCOutOctets.1000135 = Counter64: 0
IF-MIB::ifHCOutOctets.1000136 = Counter64: 0
IF-MIB::ifHCOutOctets.1000137 = Counter64: 0
IF-MIB::ifHCOutOctets.1000138 = Counter64: 0
IF-MIB::ifHCOutOctets.1000139 = Counter64: 0
IF-MIB::ifHCOutOctets.1000140 = Counter64: 0
IF-MIB::ifHCOutOctets.1000141 = Counter64: 0
IF-MIB::ifHCOutOctets.1000142 = Counter64: 0
IF-MIB::ifHCOutOctets.1000143 = Counter64: 0
IF-MIB::ifHCOutOctets.1000144 = Counter64: 0
IF-MIB::ifHCOutOctets.1000145 = Counter64: 0
IF-MIB::ifHCOutOctets.1000146 = Counter64: 0
IF-MIB::ifHCOutOctets.1000147 = Counter64: 0
IF-MIB::ifHCOutOctets.1000148 = Counter64: 0
IF-MIB::ifHCOutOctets.1000149 = Counter64: 0
IF-MIB::ifHCOutOctets.1000150 = Counter64: 0
IF-MIB::ifHCOutOctets.1000151 = Counter64: 0
IF-MIB::ifHCOutOctets.1000152 = Counter64: 0
IF-MIB::ifHCOutOctets.1000153 = Counter64: 0
IF-MIB::ifHCOutOctets.1000154 = Counter64: 0
IF-MIB::ifHCOutOctets.1000155 = Counter64: 0
IF-MIB::ifHCOutOctets.1000156 = Counter64: 0
IF-MIB::ifHCOutOctets.1000157 = Counter64: 0
IF-MIB::ifHCOutOctets.1000158 = Counter64: 0
IF-MIB::ifHCOutOctets.1000159 = Counter64: 0
IF-MIB::ifHCOutOctets.1000160 = Counter64: 0
IF-MIB::ifHCOutOctets.1000161 = Counter64: 0
IF-MIB::ifHCOutOctets.1000162 = Counter64: 0
IF-MIB::ifHCOutOctets.1000163 = Counter64: 0
IF-MIB::ifHCOutOctets.1000164 = Counter64: 0
IF-MIB::ifHCOutOctets.1000165 = Counter64: 0
IF-MIB::ifHCOutOctets.1000166 = Counter64: 0
IF-MIB::ifHCOutOctets.1000167 = Counter64: 0
IF-MIB::ifHCOutOctets.1000168 = Counter64: 0
IF-MIB::ifHCOutOctets.1000169 = Counter64: 0
IF-MIB::ifHCOutOctets.1000170 = Counter64: 0
IF-MIB::ifHCOutOctets.1000171 = Counter64: 0
IF-MIB::ifHCOutOctets.1000172 = Counter64: 0
IF-MIB::ifHCOutOctets.1000173 = Counter64: 0
IF-MIB::ifHCOutOctets.1000174 = Counter64: 0
IF-MIB::ifHCOutOctets.1000175 = Counter64: 0
IF-MIB::ifHCOutOctets.1000176 = Counter64: 0
IF-MIB::ifHCOutOctets.1000177 = Counter64: 0
IF-MIB::ifHCOutOctets.1000178 = Counter64: 0
IF-MIB::ifHCOutOctets.1000179 = Counter64: 0
IF-MIB::ifHCOutOctets.1000181 = Counter64: 0
IF-MIB::ifHCOutOctets.1000183 = Counter64: 0
IF-MIB::ifHCOutOctets.1000184 = Counter64: 0
IF-MIB::ifHCOutOctets.1000185 = Counter64: 0
IF-MIB::ifHCOutOctets.1000186 = Counter64: 0
IF-MIB::ifHCOutOctets.1000187 = Counter64: 0
IF-MIB::ifHCOutOctets.1000188 = Counter64: 0
IF-MIB::ifHCOutOctets.1000189 = Counter64: 0
IF-MIB::ifHCOutOctets.1000190 = Counter64: 0
IF-MIB::ifHCOutOctets.1000191 = Counter64: 0
IF-MIB::ifHCOutOctets.1000192 = Counter64: 0
IF-MIB::ifHCOutOctets.1000193 = Counter64: 0
IF-MIB::ifHCOutOctets.1000194 = Counter64: 0
IF-MIB::ifHCOutOctets.1000195 = Counter64: 0
IF-MIB::ifHCOutOctets.1000196 = Counter64: 0
IF-MIB::ifHCOutOctets.1000198 = Counter64: 0
IF-MIB::ifHCOutOctets.1000199 = Counter64: 0
IF-MIB::ifHCOutOctets.1000201 = Counter64: 0
... ... ... ... ... ... ... ... ... ...

As you can see, tons of rows I could be dropping (there are more than double the amount you see here, and this is for a single device!

#6

You can feed Telegraf into Kapacitor using the influxdb output, and then bring it back into Telegraf using the http_listener input.

Here is an idea that promotes a field to a tag, and then filters on the tag. I need to use a field in the same table in order for this to work, which required me to use ifHighSpeed. There are better flags on ifTable, but my ifXTable had fewer options.

I notice that my wireless interface has ifHighSpeed=“0” even though it is up, so its not a perfect solution.

[[inputs.snmp]]
  agents = [ "127.0.0.1:161" ]
  timeout = "5s"
  retries = 3
  version = 2
  community = "public"
  max_repetitions = 10
  name = "interface"

  fieldpass = ["ifOperStatus", "ifHCInOctets"]

  [[inputs.snmp.table]]
    name = 'interface'
    oid = "IF-MIB::ifXTable"

    [[inputs.snmp.table.field]]
      oid = "IF-MIB::ifHighSpeed"
      is_tag = true

  [inputs.snmp.tagdrop]
    ifHighSpeed = ["0"]
1 Like
#7

Now that I’ve had more sleep, after revisiting this, this configuration actually should work in my environment (with per-device tweaks, of course, as it appears Extreme indiscriminately sets IF-MIB::ifConnectorPresent to true even on ports that aren’t plugged in, PA hardwires IF-MIB::ifHighSpeed to the maximum PHY speed even when the port is down, etc). Vendors!!!

Anyway, thank you for your suggestion, as actually this should work better in the long run than what I was doing. I would ask that more of this type of thing be documented with examples, as without your guidance here, I don’t believe without large amounts of trial and error that I would have even gotten the syntax correct with the very limited documentation on it that I could Google up. (and just as I type that…more cowbell found! https://github.com/influxdata/telegraf/blob/master/docs/CONFIGURATION.md)

I’m touching up some other devices with filter configuration and then I’ll hopefully be ready to tackle Kapacitor integration. Thanks @daniel

Also do you know when the next Telegraf release will arrive with the Elasticsearch output that was recently committed?

#8

I don’t have a date, keep an eye on the items assigned to the 1.3.0 milestone on github.

#9

I’ve had this configuration running for a couple days now, but one lurking question I have is that I still see that additional field being pushed to Elasticsearch, even though I’ve told Telegraf to drop it (with the fieldpass parameter). Is there something glaring that I’m missing in this configuration?

[[inputs.snmp]]
  interval = "150s"
  agents = [ "127.0.0.1" ]
  community = "public"
  name = "interface_counters"

  fieldpass = ["ifname", "bytes_sent", "bytes_recv"]

  [[inputs.snmp.table]]
    name = "interface_counters"
    inherit_tags = ["hostname"]

    [[inputs.snmp.table.field]]
      name = "ifname"
      oid = "IF-MIB::ifDescr"

    [[inputs.snmp.table.field]]
      name = "bytes_recv"
      oid = "IF-MIB::ifHCInOctets"

    [[inputs.snmp.table.field]]
      name = "bytes_sent"
      oid = "IF-MIB::ifHCOutOctets"

    [[inputs.snmp.table.field]]
      oid = "IF-MIB::ifHighSpeed"
      is_tag = true

  [inputs.snmp.tagdrop]
    ifHighSpeed = ["0"]
#10

Looks right to me, haven’t heard any reports of fieldpass not working.

#11

Unfortunately right now I see ifHighSpeed field and values being output via GELF to Logstash (and consequently to Elasticsearch).

#12

I would expect ifHighSpeed to be emitted as a tag, you could tagexclude to remove it if you never want it.

#13

I literally just realized that as I got your message (it’s a tag, not a field) :confused:

Late lunch fried my brain

#14

We’re good to go! Filtering is working as expected. Thanks @daniel! Now on to Kapacitor integration :smile:

#15

Hi,
I am trying to achieve similar thing here. I want to only receive metrics for operational interfaces. I use ifXTable and ifTable, both tables have same indexes so there is no problem merging them.
I want to send data to Graphite.
This is my configuration:

Interface metrics

[[inputs.snmp.table]]
name=“interface”

[[inputs.snmp.table.field]]
name=“ifDescr”
oid=“IF-MIB::ifDescr”
is_tag=true

[[inputs.snmp.table.field]]
name=“ifOperStatus”
oid=“IF-MIB::ifOperStatus”
is_tag=true

[[inputs.snmp.table.field]]
name=“ifHCInOctets”
oid=“IF-MIB::ifHCInOctets”

[[inputs.snmp.table.field]]
name=“ifHCInUcastPkts”
oid=“IF-MIB::ifHCInUcastPkts”

[[inputs.snmp.table.field]]
name=“ifHCOutOctets”
oid=“IF-MIB::ifHCOutOctets”

[[inputs.snmp.table.field]]
name=“ifHCOutUcastPkts”
oid=“IF-MIB::ifHCOutUcastPkts”

[[inputs.snmp.table.field]]
name=“ifInDiscards”
oid=“IF-MIB::ifInDiscards”

[[inputs.snmp.table.field]]
name=“ifInErrors”
oid=“IF-MIB::ifInErrors”

[[inputs.snmp.table.field]]
name=“ifInUnknownProtos”
oid=“IF-MIB::ifInUnknownProtos”

[[inputs.snmp.table.field]]
name=“ifOutDiscards”
oid=“IF-MIB::ifOutDiscards”

[[inputs.snmp.table.field]]
name=“ifOutErrors”
oid=“IF-MIB::ifOutErrors”

[inputs.snmp.tagpass]
ifOperStatus=[“1”]

[inputs.snmp.tagdrop]
ifDescr=[“unrouted*”]

fieldpass = [“ifHCInOctets”, “ifHCInUcastPkts”, “ifHCOutUcastPkts”, “ifHCOutOctets”, “ifInDiscards”, “ifInErrors”, “ifInUnknownProtos”, “ifOutDiscards”, “ifOutErrors”]
tagexclude = [“ifOperStatus”]

I have two tags: ifDescr -for visualization and ifOperStatus -for filtering.
My goal here is to

  1. Allow metrics from only interfaces with ifOperStatus=1 (works)
  2. Deny all interfaces with description ifDescr=unrouted* (works)
  3. Cut tag ifOperStatus from the picture when sending data to Graphite (not working)

Line tagexclude = [“ifOperStatus”] seems do not take any effect.

In Graphite I get this picture:
image
But I would expect:
image

I have tried to put tag exclude to various places in the config but telegraf just failed to start. How I paste it is the only way it works.

#16

@aurimasplu You might be running into TOMl ordering issues, try moving the tagexclude and fieldpass to the beginning of the plugin configuration to avoid it being placed as part of the inputs.snmp.tagdrop table.

#17

@daniel, I have put tagexclude and fieldpass just before [[inputs.snmp.table]] and it worked like a charm :slight_smile:
thanks!!!

2 Likes
#18

Hate to dig up an old thread but I’m having issues with tagpass myself. My intent is to drop all metrics collected in a table pull where a tagged table field contains a specific metric value.

[[inputs.snmp]]
  <truncated>
  [[inputs.snmp.field]]
    name = "hostname"
    oid = "1.3.6.1.2.1.1.5.0"
    is_tag = true
  [[inputs.snmp.table]]
    name = "cpu_usage_test"
    inherit_tags = ["hostname"]
    index_as_tag = true
    [[inputs.snmp.table.field]]
      # OID to translate
      name = "cpu_usage_test_type"
      oid = "1.3.6.1.2.1.25.3.2.1.2"
      is_tag = true
    [[inputs.snmp.table.field]]
      # In Percentage [0..100]
      name = "cpu_usage_test_perc"
      oid = "1.3.6.1.2.1.25.3.3.1.2"
  [inputs.snmp.tagpass]
    cpu_usage_test_type = [“*.3.1.3”]

I’ve also tried list the full return like so…

 [inputs.snmp.tagpass]
    cpu_usage_test_type = [“.1.3.6.1.2.1.25.3.1.3”]

Neither works and both crash telegraf with an “error parsing” “toml: line x: parse error”, where x is the line containing:

cpu_usage_test_type = [“.1.3.6.1.2.1.25.3.1.3”]

I’ve tried putting the tag drop entry all over the place in this specific snmp.inputs section…litterally at every level in the snmp.inputs from before the snmp.field to before the snmp.table, to in the snmp.table.field. All tries cause the same toml parse error.

I’m currently using the 1.10.4 docker image, but I’ve tried some older branches as well. Am I just using it wrong?

#19

Make sure you aren’t using the fancy directional double quotes, only plain ascii " is allowed. That’s the only parse issue I see.

#20

Yup, just noticed the directional quotes. I don’t even know how to produce them…not sure how they got in there, but that was the culprit.