Splunk Search

How to divide each line and data row?

htramtran83
Explorer
ServiceTitle                            KPITitle                                                                           kpis_key
SmartCas                                   ServiceHealthScore                                                  SHKPI-17c3399b-d559-4e91
                                               CPU Utilization: %                                                            793faace-3431-4d54-a54c-f07fbb520425
                                                   IOWait %                                                                       9e984025-b4ba-43c1-a165
                                                   Storage Operations: Latency                                       3d063082-9fe2-48f4
                                                 GC-Major Collection Time Spent Per Min :                 33a4d376ed6e7d5aa0be31b1

The search I run is :

| inputlookup service_kpi_lookup| rename title as ServiceTitle kpis.title as KPITitle 

| fields ServiceTitle, KPITitle, kpis_key

How can I run each of line of service name is same row of KPI title and kpi key (it doesn't matter if duplicate)

thank you.

0 Karma
1 Solution

htramtran83
Explorer

I have my own answer,
I used the query with mvzip and mvindex:
my search
| eval kpis_info = mvzip(mvzip(mvzip(kpis_key, kpis_base_search, "==@@=="), kpis_search_type, "==@@=="), kpis_title, "==@@==")
| mvexpand kpis_info
| eval kpis_info=split(kpis_info, "==@@==")
| eval kpis_base_search=mvindex(kpis_info, 1)
| eval kpis
_key=mvindex(kpis_info,0)
| eval kpis_title=mvindex(kpis_info,3)
| eval kpis_search_type=mvindex(kpis_info,2)

View solution in original post

0 Karma

htramtran83
Explorer

I have my own answer,
I used the query with mvzip and mvindex:
my search
| eval kpis_info = mvzip(mvzip(mvzip(kpis_key, kpis_base_search, "==@@=="), kpis_search_type, "==@@=="), kpis_title, "==@@==")
| mvexpand kpis_info
| eval kpis_info=split(kpis_info, "==@@==")
| eval kpis_base_search=mvindex(kpis_info, 1)
| eval kpis
_key=mvindex(kpis_info,0)
| eval kpis_title=mvindex(kpis_info,3)
| eval kpis_search_type=mvindex(kpis_info,2)

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Please share the format of your CSV file.

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

richgalloway
SplunkTrust
SplunkTrust

Try

| inputlookup service_kpi_lookup| rename title as ServiceTitle kpis.title as KPITitle
| filldown ServiceTitle
| fields ServiceTitle, KPITitle, kpis_key
---
If this reply helps you, Karma would be appreciated.
0 Karma

htramtran83
Explorer

hi,

thank you for your answer.
It doesn't work unfortunately. The result is the same with the full list of KPITilte and one line of ServiceTitle.

I also try something with mvzip and mvindex, I return with wrong code.
| inputlookup service_kpi_lookup
| eval field=mvzip(mvzip(kpis._key,kpis.tilte),sec_grp)
| stats count by title field
| eval kpis_key=mvindex(split(field,","),0), KPITitle=mvindex(split(field,",")1)

0 Karma

htramtran83
Explorer

I have my own solution with :
my search...
| eval kpis_info = mvzip(mvzip(mvzip(kpis_key, kpis_base_search, "==@@=="), kpis_search_type, "==@@=="), kpis_title, "==@@==")
| mvexpand kpis_info
| eval kpis_info=split(kpis_info, "==@@==")
| eval kpis_base_search=mvindex(kpis_info, 1)
| eval kpis
_key=mvindex(kpis_info,0)
| eval kpis_title=mvindex(kpis_info,3)
| eval kpis_search_type=mvindex(kpis_info,2)

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...