# Regex: Templating -\> Graph difference

**URL:** <https://community.grafana.com/t/regex-templating-graph-difference/2780>\
**Category:** Grafana\
**Created:** [September 15, 2017, 11:18am UTC](https://community.grafana.com/t/regex-templating-graph-difference/2780 "2017-09-15T11:18:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![erdna1982](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@erdna1982](https://community.grafana.com/u/erdna1982)\
**Post date:** [September 15, 2017, 11:18am UTC](https://community.grafana.com/t/regex-templating-graph-difference/2780/1 "2017-09-15T11:18:04Z")

</div>

Hello.

I think i’ve found a bug in connection with templating regex and the values in the graph.

**The problem:**

I want to grep one especially network interface and this incoming and outgoing traffic from a zabbix template. this template receive all adapters from the windows machine.

**:example:**

_network interface to monitor:_  
Hyper-V Virtual Ethernet Adapter #2

_existing interfaces on windows:_  
Hyper-V Virtual Ethernet Adapter #2  
Hyper-V Virtual Ethernet Adapter #2-WFP 802.3 MAC Layer LightWeight Filter-0000  
Hyper-V Virtual Ethernet Adapter #2-WFP Native MAC Layer LightWeight Filter-0000  
Hyper-V Virtual Ethernet Adapter #2-QoS Packet Scheduler-0000

_templating:_  
name is netif  
regex: /^(?:Incoming|Outgoing) network traffic on Hyper-V Virtual Ethernet Adapter #2$/  
_output in template:_  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2

_selection options in dropdown:_  
all  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2

**seems good to me…but…**

_the graph shows me all the four existing interfaces, each with incoming and outgoing:_  
_item: /$netif/_  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2-WFP 802.3 MAC Layer LightWeight Filter-0000  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2-WFP Native MAC Layer LightWeight Filter-0000  
Incoming network traffic on Hyper-V Virtual Ethernet Adapter #2-QoS Packet Scheduler-0000  
_or_  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2-WFP 802.3 MAC Layer LightWeight Filter-0000  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2-WFP Native MAC Layer LightWeight Filter-0000  
Outgoing network traffic on Hyper-V Virtual Ethernet Adapter #2-QoS Packet Scheduler-0000

I’ve spend a lot of time, many regex and also the regex in graph/item but without success…

Is it on me and my regex or maybe a bug?

cheers  
Andre

---

<div class="post-metadata">

**Author:** ![erdna1982](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@erdna1982](https://community.grafana.com/u/erdna1982)\
**Post date:** [September 18, 2017, 2:50pm UTC](https://community.grafana.com/t/regex-templating-graph-difference/2780/2 "2017-09-18T14:50:35Z")

</div>

fix the problem…

In metrics use that at item and it works: /$netif$/

thx
