Splunk Search

Convert confusion matrix to tabular form

dalmaua
Explorer

Hi,

I am trying to convert the result of applying the CorrelationMatrix algorithm which is given in a confusion matrix form like:

        AA     BB     CC

AA   1        0.1    0.2

BB    0.1     1      0.3  

CC   0.2     0.3    1

And I would like to convert it to a tabular form like:

AA BB 0.1
AA CC 0.2
BB AA 0.1 
BB CC 0.3
....

So far I tried with the untable command without success. Below you can see a sample of the code I have.

 

 

index="someIndex" 
| timechart span=1m count by someField
| fillnull value=0
| fit CorrelationMatrix method=pearson * 
| untable a, b, c

 

 

 

Any help would be much appreciated, 

Thanks!

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Assuming the first column is called index

| makeresults 
| eval _raw="index AA     BB     CC
AA    1        0.1    0.2
BB    0.1     1      0.3  
CC   0.2     0.3    1"
| multikv forceheader=1
| table index AA BB CC


| untable index name value
| where index!=name

View solution in original post

0 Karma

dalmaua
Explorer

Thanks, it worked!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming the first column is called index

| makeresults 
| eval _raw="index AA     BB     CC
AA    1        0.1    0.2
BB    0.1     1      0.3  
CC   0.2     0.3    1"
| multikv forceheader=1
| table index AA BB CC


| untable index name value
| where index!=name
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...