Splunk Search

Extracted fields in same table

SS1
Path Finder

Hi,

I have extracted 2 fields i.e. field1 & field2, while using the stats count command how do i use these extracted fields so that they show up in same table like below

source     issue      _time

userx       field1         12:00

usery        field1          13:00

userz         field2         14:00

 

Or should i use 2 different tables for  field1 and field2

below are the searches i am using

index=test1 | rex field=source "\\\\(?<source>\w+)-(?<issue>\w+)\.log$" | stats count by source,_time,field1| sort -_time| fields source,_time,field1

index=test1 | rex field=source "\\\\(?<source>\w+)-(?<issue>\w+)\.log$" | stats count by source,_time,field2 | sort -_time| fields source,_time,field2

 

 

 

Labels (5)
0 Karma

SS1
Path Finder

Sorry, i phrased the table wrong. field 1 and field2 are does not fall under issue

below is how i need the table,

source     Notification      _time

userx       field1                 12:00

usery        field1                13:00

userz         field2                14:00

0 Karma

manjunathmeti
Champion

Then you can append 2nd query results to first one:

index=test1 | rex field=source "\\\\(?<source>\w+)-(?<issue>\w+)\.log$" | stats count by source,_time,field1| sort -_time| fields source,_time,field1 | eval Notification="field1" | append [ search index=test1 | rex field=source "\\\\(?<source>\w+)-(?<issue>\w+)\.log$" | stats count by source,_time,field1 | sort -_time| fields source,_time,field2 | eval Notification="field2"] | fields Notification, source, _time| stats max(source) as source, max(_time) as _time by Notification
0 Karma

manjunathmeti
Champion

hi @SS1,

If field1 and field2 are values of field issue, then you only need one query:

index=test1 | rex field=source "\\\\(?<source>\w+)-(?<issue>\w+)\.log$" | stats count by source,issue,_time | fields -count

 

0 Karma
Get Updates on the Splunk Community!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

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 ...