A user is seeking help with writing data to an index using sip data. They provided a script for gathering device information and converting it into a JSON object, but are running into issues with the data only showing up in device events instead of the desired index. Another user suggested using "SIP DATA" instead of "SIP EVENT" and requested to see the script for further assistance. The original user provided the script for reference.
Read the entire ‘Help with writing data to an index using sip data at ControlUp’ thread below:
Good morning all and happy holidays! I need some help with writing data to an index. I have a script written to get hardware hash information from a device and create a csv/json file on the local drive. I want to convert this to upload the data into an index. The problem I am running into is when I attempt to do so, the data shows up in the device events of the device instead of in an index. I probably have the SIP Event completely wrong. Any help would be appreciated 😄
for data you need to use sip data
https://support.controlup.com/docs/scripting-guide?highlight=sip%20data#writing-to-a-data-index
I am using the sip data, however, when I do it only writes the output to the device events instead of to a custom index.
in your first post you mentioned sip event that’s why I replied that, can you share the json that you output?
“`
Collect device details
$CompName = $env:COMPUTERNAME
$session = New-CimSession
$serial = (Get-CimInstance -CimSession $session -Class Win32_BIOS).SerialNumber
$devDetail = Get-CimInstance -CimSession $session -Namespace root/cimv2/mdm/dmmap -Class MDM_DevDetail_Ext01 -Filter "InstanceID=’Ext’ AND ParentID=’./DevDetail’"
$hash = $devDetail.DeviceHardwareData
$product = "" # Windows Product ID placeholder
Build object for JSON
$deviceInfo = [pscustomobject]@{
ComputerName = $CompName
SerialNumber = $serial
WindowsProductID = $product
HardwareHash = $hash
Timestamp = (Get-Date).ToString("s")
}
Write-Output ("### SIP EVENT BEGINS ###")
Write-Output -InputObject $deviceInfo | ConvertTo-Json
Write-Output ("### SIP EVENT ENDS ###")“`
This is the script.
and you use SIP EVENT BEGINS that has to be SIP DATA
Continue reading and comment on the thread ‘Help with writing data to an index using sip data at ControlUp’. Not a member? Join Here!
Categories: All Archives, ControlUp for VDI, ControlUp Scripts & Triggers
