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!

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...