Splunk Search

Display multi date_wday values in single column

ahogbin
Communicator

Hello,

I am attempting (unsuccessfully so far) to display multiple date_wday values in a single table column.

My search checks for errors over a 7 day period. There are errors that occur on multiple days or may only occur after a certain day (in the case of application updates etc).

My end aim is to produce table that has the error and the days that the error occurred on.
<Search> | table error dayserroroccurredon

++Output++
ERROR XXXXX Mon, Tues, Wed
ERROR XXXXX Wed, Thursday

I have tried various appends but none give me the result I want and simply put each day on a new line

Is there away to combine the day values into a single field that can then be outputted to a table ?

Any help or advise will be greatly appreciated.

Cheers,

Alastair

Tags (3)
0 Karma
1 Solution

woodcock
Esteemed Legend

It is hard to be sure without more detail but perhaps this:

... | stats values(date_wday) AS dayserroroccurredon BY error | nomv dayserroroccurredon

The stats command creates a multivalued field and the nomv command merges all the values into a single whitespaced conglomerated value.

View solution in original post

0 Karma

woodcock
Esteemed Legend

It is hard to be sure without more detail but perhaps this:

... | stats values(date_wday) AS dayserroroccurredon BY error | nomv dayserroroccurredon

The stats command creates a multivalued field and the nomv command merges all the values into a single whitespaced conglomerated value.

0 Karma

ahogbin
Communicator

Works a treat.. thank you.

Now just to work out how to get the count of the number of times the error occurred.

0 Karma

ahogbin
Communicator

Thank you... I ended up adding
stats values(date_wday) AS dayserroroccurredon count(errortype) AS errCount BY errortype but I prefer your way as it is neater and easier to understand.
Cheers and thanks again for your help

0 Karma

woodcock
Esteemed Legend

Like this:

... | stats count values(date_wday) AS dayserroroccurredon BY error | nomv dayserroroccurredon
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...