Splunk Dev

How to store Multi Value Field with its sum of number of occurrence in the 4m span of time

santosh121
Explorer

Dear All,

 

 I am trying to store some aggregated values so that my query will perform better way when searching time is of 6-8 months.

 

Use case:

_time                                                       Environment       BG         ApplicationName      Interface    ErrorType

22-05-2021 01:12:33                             E                          B                          K                            Z                  TimeOut

22-05-2021 01:13:33                             E                          B                          K                            Z              HttpConnectivityErr

22-05-2021 01:14:33                             E                          B                          K                            Z                  TimeOut

22-05-2021 01:15:33                             E                          B                          K                            Z             HttpConnectivityErr

22-05-2021 01:16:33                             E                          B                          K                            Z                  TimeOut

22-05-2021 01:17:33                             E                          B                          K                            Z              HttpConnectivityErr

22-05-2021 01:18:33                             E                          B                          K                            Z              HttpConnectivityErr

22-05-2021 01:19:33                             E                          B                          K                            Z              HttpConnectivityErr

Expected Output:

bin span 4m  _time

 

_time                                            Environment       BG         ApplicationName      Interface        ErrorType(multiValue)

22-05-2021 01:12:33                   E                          B                          K                            Z                     TimeOut_2

                                                                                                                                                                               HttpConnectivityErr_2

22-05-2021 01:16:33                   E                          B                          K                            Z                      TimeOut_1

                                                                                                                                                                               HttpConnectivityErr_3

 

What i want is for a span of 4 min i need unique  "ErrorType" column along with its count group by Environment,BG,ApplicationName,Interface.

Please help me out with it.

 

Regards,

Santosh

 

0 Karma
1 Solution

santosh121
Explorer

Thanks for the reply. I will test from my side today and update you on that.

Regards,

Santosh

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| makeresults
| eval _raw="time,Environment,BG,ApplicationName,Interface,ErrorType
22-05-2021 01:12:33,E,B,K,Z,TimeOut
22-05-2021 01:13:33,E,B,K,Z,HttpConnectivityErr
22-05-2021 01:14:33,E,B,K,Z,TimeOut
22-05-2021 01:15:33,E,B,K,Z,HttpConnectivityErr
22-05-2021 01:16:33,E,B,K,Z,TimeOut
22-05-2021 01:17:33,E,B,K,Z,HttpConnectivityErr
22-05-2021 01:18:33,E,B,K,Z,HttpConnectivityErr
22-05-2021 01:19:33,E,B,K,Z,HttpConnectivityErr"
| multikv forceheader=1
| fields - _* linecount 
| eval _time=strptime(time,"%d-%m-%Y %H:%M:%S")
| bin _time span=4m
| stats count by _time Environment BG ApplicationName Interface ErrorType
| eval ErrorType=ErrorType."_".count
| stats values(ErrorType) as ErrorType by _time Environment BG ApplicationName Interface
0 Karma

santosh121
Explorer

Thanks for the reply. I will test from my side today and update you on that.

Regards,

Santosh

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...