Splunk Enterprise

How can I (or is it even possible to) make arrays out of a and b?

rberman
Path Finder

Suppose I have data as follows:

| makeresults
| eval a = mvappend(a, "\"1\"")
| eval a = mvappend(a, "\"2\"")
| eval a = mvappend(a, "\"3\"")
| eval a = mvappend(a, "\"4\"")
| eval a = mvappend(a, "\"5\"")
| eval b= mvjoin(a, ",")
| table a, b

Using SPL, how can I (or is it even possible to) make arrays out of a and b so that I have fields c=["1","2","3","4","5"]  and d=["1","2","3","4","5"] where c is an array of 5 quoted numerical values and d is an array of 1 single string of the comma separated string: "1","2","3","4","5"

I know I can get arrays of values via extraction from JSON but is there a way to do this without JSON?

Labels (1)
Tags (3)
0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...