So when I get a specific type of syslog message, I pass the hostname, IP and message over to a powershell script in syslog viewer and this then send a message to slack via a webhook
The problem I am having is getting the Custom property estate form the DB using SWQL
I have tried:
1.
$CE = Get-SwisData $swis -query "select n.customproperties.Estate from orion.nodes n where IPAddress=@nip" @{nip=$IPaddress}
2.
$query = "select n.customproperties.Estate from orion.nodes n where IPAddress=@ipaddr"
#$CE = Get-SwisData $swis -query $query @{ipaddr=$IPAddress}
3.
$CE = Get-SwisData $swis -query "SELECT n.customproperties.Estate FROM orion.nodes n WHERE IP=$IPAddress"
I an get the to work when I run them from a powershell prompt, using all the relevant connection code. but when it runs from the script, the value for the custom property Estate is blank and the nodes I'm testing it on do have this custom value set
Can anyone help me - slowly pulling my hair out here