# How to set the hostname in telegraf file such that its always in lowercase currently i am using empty string

**URL:** <https://community.influxdata.com/t/how-to-set-the-hostname-in-telegraf-file-such-that-its-always-in-lowercase-currently-i-am-using-empty-string/4828>\
**Category:** Systems\
**Tags:** influxdb, telegraf, grafana\
**Created:** [April 19, 2018, 4:24pm UTC](https://community.influxdata.com/t/how-to-set-the-hostname-in-telegraf-file-such-that-its-always-in-lowercase-currently-i-am-using-empty-string/4828 "2018-04-19T16:24:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rkanth18](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/rkanth18/32/1244_2.png) [@rkanth18](https://community.influxdata.com/u/rkanth18)\
**Post date:** [April 19, 2018, 4:24pm UTC](https://community.influxdata.com/t/how-to-set-the-hostname-in-telegraf-file-such-that-its-always-in-lowercase-currently-i-am-using-empty-string/4828/1 "2018-04-19T16:24:19Z")

</div>

Some of our servers have the computer names in Upper case and some in lowercase.

Any-idea how to make them all in lowercase such that in the grafana and other dashboards it looks good

Currently its set to hostname = “” ( empty string )

Thanks  
Sri

---

<div class="post-metadata">

**Author:** ![daniel](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/daniel/32/142_2.png) [@daniel](https://community.influxdata.com/u/daniel)\
**Post date:** [April 19, 2018, 6:16pm UTC](https://community.influxdata.com/t/how-to-set-the-hostname-in-telegraf-file-such-that-its-always-in-lowercase-currently-i-am-using-empty-string/4828/2 "2018-04-19T18:16:37Z")

</div>

There isn’t an easy way to do this. Perhaps this proposed processor plugin would help, could you add your use case to the comment thread?

> <https://github.com/influxdata/telegraf/pull/3890>
>
> My own use case means I need to convert the values of tags from upper case to lo…wer case (or vice versa) because IIS logs I've been working with contain the character case originally expressed in each request, but this means statistics are not aggregated together by the basicstats aggregator.
> 
> I tried building and using the regex processor, #3839 , but regex in golang doesn't support the case transformations available in Perl with \\L and \\U. Everything else about the plugin was a perfect fit so I copied its structure and want to credit @44px for most of the hard work. The plugin just calls strings.ToLower on the tags and fields specified.
> 
> \### Configuration Example
> \`\`\`
> \[\[processors.lowercase\]\]
> namepass = "iis\_log"
> \[\[processors.lowercase.tags\]\]
> key = "01\_uriStem"
> \`\`\`
> 
> \### Source metric from logparser
> \`\`\`
> iis\_log,host=MYMACHINE,02\_method=GET,01\_uriStem=/api/Healthcheck,03\_response=200 port="7314",protocolVersion="HTTP
> /1.1",serverName="MYHOST",log\_timestamp="2018-03-08 00:02:59",clientIP="fe80::beef:beef:feeb:9071%12",bytesSent=436i,req
> uestHost="THEIRHOST:7314",referer="-",userAgent="Mozilla/5.0+(Windows+NT;+Windows+NT+6.3;+en-GB)+WindowsPowerShell/5.1.1
> 4409.1012",serverIP="fe80::beef:beef:beef:9071%12",timetaken=1781i,username="-",serviceName="W3SVC11",win32response="0",
> uriQuery="-",bytesReceived=178i,subresponse="0" 1521122773998868100
> iis\_log,02\_method=GET,01\_uriStem=/API/healthcheck,03\_response=200,host=MYMACHINE uriQuery="-",username="-",bytesSe
> nt=436i,bytesReceived=178i,clientIP="fe80::beef:beef:feeb:9071%12",serverName="MYHOST",serverIP="fe80::beef:beef:beef:90
> 71%12",userAgent="Mozilla/5.0+(Windows+NT;+Windows+NT+6.3;+en-GB)+WindowsPowerShell/5.1.14409.1012",subresponse="0",log\_
> timestamp="2018-03-08 00:03:00",protocolVersion="HTTP/1.1",serviceName="W3SVC11",port="7314",timetaken=1781i,referer="-"
> ,requestHost="THEIRHOST:7314",win32response="0" 1521122773998868101
> \`\`\`
> 
> \### Results
> \`\`\`
> iis\_log,host=LAPTOP-A5GCJ6G9,03\_response=200,02\_method=GET,01\_uriStem=/api/healthcheck uriQuery="-",requestHost="THEIRHO
> ST:7314",timetaken=1781i,bytesReceived=178i,userAgent="Mozilla/5.0+(Windows+NT;+Windows+NT+6.3;+en-GB)+WindowsPowerShell
> /5.1.14409.1012",serverName="MYHOST",bytesSent=436i,username="-",clientIP="fe80::beef:beef:feeb:9071%12",log\_timestamp="
> 2018-03-08 00:02:59",subresponse="0",serverIP="fe80::beef:beef:beef:9071%12",port="7314",win32response="0",referer="-",s
> erviceName="W3SVC11",protocolVersion="HTTP/1.1" 1521122905846447300
> iis\_log,02\_method=GET,03\_response=200,host=LAPTOP-A5GCJ6G9,01\_uriStem=/api/healthcheck subresponse="0",serviceName="W3SV
> C11",protocolVersion="HTTP/1.1",serverName="MYHOST",bytesSent=436i,port="7314",serverIP="fe80::beef:beef:beef:9071%12",b
> ytesReceived=178i,clientIP="fe80::beef:beef:feeb:9071%12",username="-",uriQuery="-",win32response="0",log\_timestamp="201
> 8-03-08 00:03:00",userAgent="Mozilla/5.0+(Windows+NT;+Windows+NT+6.3;+en-GB)+WindowsPowerShell/5.1.14409.1012",requestHo
> st="THEIRHOST:7314",timetaken=1781i,referer="-" 1521122905846447301
> \`\`\`
> 
> \### Required for all PRs:
> 
> \- \[x\] Signed \[CLA\](https://influxdata.com/community/cla/).
> \- \[x\] Associated README.md updated.
> \- \[x\] Has appropriate unit tests.
