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!

Build Scalable Security While Moving to Cloud - Guide From Clayton Homes

 Clayton Homes faced the increased challenge of strengthening their security posture as they went through ...

Mission Control | Explore the latest release of Splunk Mission Control (2.3)

We’re happy to announce the release of Mission Control 2.3 which includes several new and exciting features ...

Cloud Platform | Migrating your Splunk Cloud deployment to Python 3.7

Python 2.7, the last release of Python 2, reached End of Life back on January 1, 2020. As part of our larger ...