# Rename Network Interface

**URL:** <https://community.influxdata.com/t/rename-network-interface/14139>\
**Category:** Telegraf\
**Tags:** telegraf\
**Created:** [May 2, 2020, 6:21pm UTC](https://community.influxdata.com/t/rename-network-interface/14139 "2020-05-02T18:21:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arrmo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/arrmo/32/4860_2.png) [@arrmo](https://community.influxdata.com/u/arrmo)\
**Post date:** [May 2, 2020, 6:21pm UTC](https://community.influxdata.com/t/rename-network-interface/14139/1 "2020-05-02T18:21:31Z")

</div>

Hi,

Likely a dumb question, but I just can’t seem to find it ☹. I have a few machines, collecting data via Telegraf (which is working great, thanks!) … but, I am also using a Grafana dashboard to display the results. Both are working OK, with one exception - my graphs break because the various machines use different names for their network interfaces. So I’d like to have Telegraf use a name I define.

For example, I see in my telegraf database,  
`net,host=linuxBox,interface=enp0s10`

Yet on another machine, that interface is p1p1, and another, eth0. I’d like to name them all, for example, lan. I have tried [[processors.rename.replace]], but that doesn’t seem to do it. Any suggestions?

Thanks!

---

<div class="post-metadata">

**Author:** ![arrmo](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/arrmo/32/4860_2.png) [@arrmo](https://community.influxdata.com/u/arrmo)\
**Post date:** [May 2, 2020, 9:14pm UTC](https://community.influxdata.com/t/rename-network-interface/14139/2 "2020-05-02T21:14:43Z")

</div>

OK, I found the regex processor - seems to be what I need, but it’s not quite working (likely me!). Here is what I have as the regex config,

```
[[processors.regex]]
  namepass = ["net"]
  [[processors.regex.tags]]
    key = "interface"
    pattern = "enp0s10"
    replacement = "lan"

```

But when I run,  
`telegraf --config /etc/telegraf/telegraf.conf --input-filter net --test`

I get,

```
2020-05-02T21:13:08Z I! Starting Telegraf 1.14.2
> net,host=cpqServer,interface=enp0s10 bytes_recv=48539164i,bytes_sent=79017764i,drop_in=41654i,drop_out=0i,err_in=0i,err_out=0i,packets_recv=420469i,packets_sent=308732i 1588453989000000000

```

Doesn’t seem to be applying regex as desired (to change interface=enp0s10 to interface=lan)?

Thanks!

---

<div class="post-metadata">

**Author:** ![Anaisdg](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/anaisdg/32/6401_2.png) [@Anaisdg](https://community.influxdata.com/u/Anaisdg)\
**Post date:** [May 4, 2020, 9:24pm UTC](https://community.influxdata.com/t/rename-network-interface/14139/3 "2020-05-04T21:24:12Z")

</div>

Hello @arrmo,  
It isn’t you! The `telegraf --test` command doesn’t run the processors, it’s something the team has been meaning to change but never get the time. I usually debug this by adding a `file` output writing to stdout and then run Telegraf for a bit with only the plugins of interest, this way I avoid writing unwanted data to my database:

```auto
telegraf --input-filter=snmp --output-filter=file

```

^taken from [Snmp input regex conversion help](https://community.influxdata.com/t/snmp-input-regex-conversion-help/10651)

[Issue 6290](https://github.com/influxdata/telegraf/issues/6190)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/3X/2/f/2feb065bdfd5e4b7728243aa3b9192ad3e8447c1.png) [@system](https://community.influxdata.com/u/system)\
**Post date:** [May 27, 2020, 3:07am UTC](https://community.influxdata.com/t/rename-network-interface/14139/4 "2020-05-27T03:07:46Z")

</div>

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.
