Splunk Search

How to combine or merge two or more fields?

m0rt1f4g0
Explorer

Hi.

How do I combine these two fields, since the username is similar?

The result of my query is the following:

user                                                                                                  EventID        count
----------------------------------------------------------------- |------------|------------ |
dsanchez.ext3                                                                         |   4740     |     3            |
----------------------------------------------------------------- |------------|------------ |
dsanchez.ext3                                                                         |   4767     |      3           | 
----------------------------------------------------------------- |------------|------------ |
dsanchez.ext3@domain.com                                           |   4625     |    10          |
----------------------------------------------------------------- |------------|-------------|

I would like the following:

user                                                           EventID                                    count
-----------------------------------------------------|------------------- |--------------|
dsanchez.ext3                                                     |       4740             |        3           |
dsanchez.ext3                                                     |       4767             |        3           |
dsanchez.ext3@domain.com                       |      4625              |       10         |
-----------------------------------------------------------------------------------------

My query is:

index=oswinsec user=dsanchez* EventID=4625 OR EventID=4740 OR EventID=4767
|stats count by user, EventID

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| eval u=mvindex(split(user,"@"),0)
| stats list(*) as * by u
| fields - u

View solution in original post

m0rt1f4g0
Explorer

@ITWhisperer Thanks! 🙂 🤓

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| eval u=mvindex(split(user,"@"),0)
| stats list(*) as * by u
| fields - u
Get Updates on the Splunk Community!

Data Management Digest – November 2025

  Welcome to the inaugural edition of Data Management Digest! As your trusted partner in data innovation, the ...

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...