I have setup Grafana Dashboard that pulls hosts from InfluxDBV2 with a custom list of windows hosts within the variables, my problem is that the HOSTS can be either uppercase or lowercase so when setting the variable I have to put in both Upper and Lowercase versions - this is a bit messy as on the dropdown it shows both and 1 does not work, how can i get around this?
The custom list is
server1,server2,server3 etc
I cant see where i can change this to be case insensitive
We have pretty much same use case regarding the naming. A lot of the systems we monitor have been confiigured by other people who have used different naming conventions throughout.
We force all tags in to uppercase to be honest to make it easier to manage.
@ThePeltonian You can just force the correct case in your query using the strings package. This is a lot easier if the correct case is lower. You’ll also need to use the regexp to convert the forced-lowercase host value into a usable regexp type:
Hi Scott thanks for that, when implement the above it does not work - on the selection I choose an uppercase host nothing comes back but when changing the hostValue = strings.toLower(v: “${comp:pipe}”) to hostValue = strings.toUpper(v: “${comp:pipe}”) it pulls back the uppercase selected host metrics
I think the issue is that the “Hosts” are in InfluxDB as mixed case some lower some upper so unable to predict which.
Have just tried the above within the telegraf.conf - failed start, I tried within the Global / Agent tags and within the outputs and inputs sections all failed to start.
@ThePeltonian I just learned something new in Flux today. You can add flags to a regular expression to make it case-insensitive. The only catch is that you can only do it if you’re using the regexp package (for now at least).
[[processors.strings]]
## Convert a tag value to uppercase
[[processors.strings.uppercase]]
tag = "host"
Also, I’m not sure if its the formatting on the forums or not but the double quotes don’t seem right.
[[processors.strings.uppercase]]
tag = “host”
try with “host” instead.
I place that at the very end of my main configuration file with all the connection details in and its applied to all my metrics, however I force all tags to uppercase so i just use the wildcard
[[processors.strings]]
## Convert a tag value to uppercase
[[processors.strings.uppercase]]
tag = "*"
As for Grafana, maybe that regex function works in influx but not Grafana. I don’t know about influx 2.0 though so its just a vage guess.
EDIT: Actually, i think you might have included that full processor block. I just saved this post and the first section of the definition is formatted in bold text.
It might be better to wrap config snippets in the code formatting
I have a couple of servers that have old sql 2005 database’ that have been upgraded to 2012 (i think its 2012) but telegraf starts but then stops when it gets to collecting that data.
I can add in the base configuration but not the Inputs.sql
I was wondering about using the database_type = sql_server but cant find any examples of telegraf configs with it in.
It should be simple enough to set up. does telegraf output any errors when connecting?
If i recall, you just need to create a user with the correct permissions and set up the connection string in the config. I can’t remember if I had to make any firewall changes or network settings in the SQL server instance itself.
Hi @philb sorry been away from work, no errors the config is the same as the ones on the other servers - firewall is open etc as I can add in the basic Telegraf config without the SQL additions and it worked.
I have read that Telegraf has issues with older versions of SQL so was wondering if the upgraded db;s had some remnants left in there somewhere that causes Telegraf to stop