Splunk Search

Powershell output containing Curly braces gets parsed as System.String[]. How to parse and extract fields within the curly braces?

saurabhkunte
Path Finder

Hello,

I hope one of you here can help me out.

I have a PowerShell script which is am running via PS modular input. Some of the output is contained in curly braces, for e.g:

DNSServerOrder : {10.191.125.141, 10.192.19.250}
DNSSuffixSearch : {a.contoso.com, b.contoso.com, c.contoso.com, c.contoso.com...}
IPAddress :{192.168.5.5}

The values for these three fields show up as 'System.String[]'. I am guessing string arrays is somehow not getting parsed at index-time. Any help how to get these fields to show the values that are enclosed within the curly braces?
Thanks

0 Karma

jconger
Splunk Employee
Splunk Employee

Can you share the bits of PoSH writing out those strings? PowerShell has internal handlers on how to display objects and you may have to tweak your Write-Host.

0 Karma
Get Updates on the Splunk Community!

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL

Splunk AI Assistant for SPL | Key Use Cases to Unlock the Power of SPL  The Splunk AI Assistant for SPL ...

Buttercup Games: Further Dashboarding Techniques (Part 5)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Customers Increasingly Choose Splunk for Observability

For the second year in a row, Splunk was recognized as a Leader in the 2024 Gartner® Magic Quadrant™ for ...