Knowledge Management

How to extract the values from array?

mcohen13
Loves-to-Learn

I have a field that his elements looks the following:

["bedep","banjori","gameover","dyre","suppobox","necurs","unknown","conficker","kraken","emotet","mirai","virut","ccleaner"]

How can I only extract the names of the threats with "" from the array on a different field?

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

By using split:

| makeresults 
 | eval name="[\"bedep\",\"banjori\",\"gameover\",\"dyre\",\"suppobox\",\"necurs\",\"unknown\",\"conficker\",\"kraken\",\"emotet\",\"mirai\",\"virut\",\"ccleaner\"]"
 | eval new_name = name
 | rex field=new_name mode=sed "s/\[|\]|\"//g"
 | eval new_name = split(new_name,",")
0 Karma

woodcock
Esteemed Legend

Like this:

| makeresults 
| eval name="[\"bedep\",\"banjori\",\"gameover\",\"dyre\",\"suppobox\",\"necurs\",\"unknown\",\"conficker\",\"kraken\",\"emotet\",\"mirai\",\"virut\",\"ccleaner\"]"
| eval new_name = name
| rex field=new_name mode=sed "s/[\[\]]//g"
| makemv delim="," new_name
| rex field=new_name mode=sed "s/\"//g"
0 Karma

vnravikumar
Champion

Hi

Try this

| makeresults 
| eval name="[\"bedep\",\"banjori\",\"gameover\",\"dyre\",\"suppobox\",\"necurs\",\"unknown\",\"conficker\",\"kraken\",\"emotet\",\"mirai\",\"virut\",\"ccleaner\"]" 
| eval result = replace(name, "\[|\]|\"","") 
| makemv delim="," result
0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...