Getting Data In

Trying to get eval to push multiple values to one field

doingathing
Engager

Currently trying to get eval to give multiple returns

 

 

| eval mitre_category="persistence,Defense_Evasion"
| eval apt="apt1,apt2,apt3"

 

I would like the values to be listed as OR. that way i get `apt2` or `apt3` instead of searching for `apt1,apt2,apt3`. I would like to know if there is a way to do this via one query instead of several if at all possible.

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Create a multi-value field using mvappend (there are other ways, too).

| eval mitre_category=mvappend("persistence","Defense_Evasion")
| eval apt=mvappend("apt1","apt2","apt3")

The search command, however, doesn't work well with multi-value fields so this probably will not solve your problem.  What problem are you trying to solve, exactly?  Tell us about the root problem so we can offer other possible answers.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Create a multi-value field using mvappend (there are other ways, too).

| eval mitre_category=mvappend("persistence","Defense_Evasion")
| eval apt=mvappend("apt1","apt2","apt3")

The search command, however, doesn't work well with multi-value fields so this probably will not solve your problem.  What problem are you trying to solve, exactly?  Tell us about the root problem so we can offer other possible answers.

---
If this reply helps you, Karma would be appreciated.

ITWhisperer
SplunkTrust
SplunkTrust

It is not clear what you are trying to do. Are you trying to search for events where the field may have one of a number of different values?

| search apt IN ("apt1","apt2","apt3")
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Splunk Add-on for Microsoft Windows 11.0.3: Parse Once, Search Faster

The updated Splunk Add-on for Microsoft Windows helps customers search Windows events faster by reducing ...

What's New in Splunk Enterprise Security 8.8 and Beyond

Threats move at machine speed. Keeping up should not depend on having the biggest budget, the largest team, or ...

A Four-Part Event Series: State of Observability - Where AI Meets Performance

As AI agents take on more complex tasks, teams need greater visibility into how they behave, what they cost, ...