Possible to import PowerShell output into Influx then Grafana?

Hello,

I’ve been trying for so long to get this working.

I’m been using Grafana and Influx lately and love it. I’ve been using Telegraf and Prometheus as well and have manged to get various systems into Grafana.

In the last week I have finally managed (with a lot of help) to get some PowerShell outputs into Influx using the Influx PowerShell Module. I’ve used it to get metrics from Citrix, so things like connected user numbers, just simple stuff.

My knowledge of PS is Novice level, but I’ve bought 2 uDemy courses to learn the basics.

What I really want to do is get usernames, servername, state, logon times, etc listed in Grafana, but I’m not sure Influx can hold this sort of info, does it only store numeric information?

This PowerShell script is perfect and shows as nice table output that I’d love to show in Grafana, I run in on the Citrix broker server and the Output is good:

https://pastebin.com/rVhzHf9j

Output looks like this (blurred usernames) https://imgur.com/auJLjlv

So I tried to see if I could at least get usernames into Grafana, but something is not right, here is the PS script:

https://pastebin.com/ydQz6riA

This is what I see in Grafana: https://imgur.com/Hjh1zNQ

So I can select the host and see the fields in the script, but something is not right as there is no way to show the usernames. If I can get that in there I want to build on this and add logon time, servername etc.

Am I attempting something that is impossible?

You can store those data into InfluxDB.
You have to split your input data in tags and fields, have a look at the docs here.

The fields are those ones you see as available in the select list, tags will be available in the WHERE and GROUP BY sections. adding a tag to the “group by” will actually output it in the table.
This is what Grafana allows it to do with his guided query interface.

Ofc you can just write the query yourself by going in “text edit mode”, here you have to write the query (InfluxQL) yourself, in the same way, you would do using the Influx CLI or Chronograf. You can still use Grafana variables etc.
Here Grafana does not impose any limitation, do you want a flat SELECT, or subqueries or any other “advanced syntax”, no problem, it’s a just InfluxQL string for grafana

I recommend you build a basic query in “guided mode” and then switch to “text edit mode” in order to see how some parts of the query use Grafana variables.

note that if you use the “text edit mode” and then switch back to “guided mode” you will actually lose all your handmade InfluxQL… so never switch back, and if you do… don’t save…