- print $curl "ifstat,host=$host,port=$port$vlan ",
- $direction[$i*2], "=", $v[$i*2+1] * 1024, ",",
- $direction[$i*2+1], "=", $v[$i*2+2] * 1024,
+ my $port = $if[$i];
+ if ( $port =~ m/if(\d\d)(\d\d\d\d)/ ) {
+ push @tags, "prefix=$1,vlan=$2";
+ } elsif ( m/if(\d+)/ ) {
+ push @tags, "port=$1";
+ }
+
+ print $curl "ifstat,", join(',', @tags),
+ " ", $direction[$i*2], "=", ( $v[$i*2+1] * 1024 ),
+ ",", $direction[$i*2+1], "=", ( $v[$i*2+2] * 1024 ),