Splunk Search

How to create common name for 3 different fields in an event?

Navanitha
Path Finder

I have event like below and I am trying to create a common field for  CI_Name / Hostname /IP_Address and name it as Generic_HostName.

2023-06-21 07:46:38.701, CI_Name="abc.xyz.net", Hostname="abc", Domain="xyz.net", System_Role="DR", Environment="DR", IP_Address="40.90.20.10", Tier1="Hosting", Tier2="Processing unit", Tier3="Server", BU="poc", Operating_System="Red Hat Enterprise Linux 7.9", OS_Version="7.9",

 

So when I do a stats on Generic_Hostname, the result should have CI_Name, Hostname, IP_Address.

index=* | stats count by Generic_Hostname

Output:

abc.xyz.net

abc

40.90.20.10

 

How can I achieve this?  

 

Labels (2)
0 Karma
1 Solution

yuanliu
SplunkTrust
SplunkTrust

The command you are looking for is mvappend.

Generic_Hostname = mvappend(CI_Name, Hostname, IP_Address)

Hope this helps.

View solution in original post

Tags (1)

yuanliu
SplunkTrust
SplunkTrust

The command you are looking for is mvappend.

Generic_Hostname = mvappend(CI_Name, Hostname, IP_Address)

Hope this helps.

Tags (1)

Navanitha
Path Finder

Thank you @yuanliu.  This is exactly what I was looking for.

0 Karma
Get Updates on the Splunk Community!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

New Release | Splunk Cloud Platform 10.1.2507

Hello Splunk Community!We are thrilled to announce the General Availability of Splunk Cloud Platform 10.1.2507 ...

🌟 From Audit Chaos to Clarity: Welcoming Audit Trail v2

🗣 You Spoke, We Listened  Audit Trail v2 wasn’t written in isolation—it was shaped by your voices.  In ...