Posted this on Github was told to post over here.
Directions
I have installed telegraf-1.5.2 agent on Windows machine and it seems to be working fine.
I want to change the hostname to take a system variable instead of a default hostname.
Giving a system variable in hostname is not working. It is still taking the default hostname.
Bug report
Relevant telegraf.conf:
#Override default hostname, if empty use os.Hostname()
hostname = “$USERNAME”
omit_hostname = false
System info:
[Include Telegraf version, operating system name, and other relevant details]
Telegraf Version: telegraf-1.5.2_windows
OS Name: Windows 7
Telegraf is sending data to InfluxDB
Expected behavior:
When I give the hostname
hostname = “$USERNAME”
It is supposed to take the username of the machine I am installing Telegraf on
Actual behavior:
But instead of taking the username of the system it is still taking the default hostname.
Additional info:
[Include gist of relevant config, logs, etc.]
Feature Request
Opening a feature request kicks off a discussion.
Proposal:
Why is the hostname not taking the variable tag
Current behavior:
updating variables in hostname is not working it is still taking the default hostname.
Desired behavior:
Updating variables in the hostname should take the variable name we are using instead of default hostname.
When I run the C:\path to \telegraf\telegraf.exe --config C:\path to\telegraf\telegraf.conf --test
I get the bellow result, Part of the result is this, This says that the host=myusername is taking the hostname i want. But in the logs And in InfluxDB too it is updating the default hostname.
diskio,project=infrastructure,os=windows,customer=mmltest,name=C:,factory=project,platform=aws,host=myusername read
s=0i,writes=0i,read_bytes=0i,read_time=0i,write_bytes=0i,write_time=0i,io_time=0i,weighted_io_time=0i,iops_in_progress=0
i 1522186143000000000