Dashboards & Visualizations

How to get the no of rows in a table without count field

AdixitSplunk
Path Finder

Hi ,
Please help me with the below format for a splunk query .I want a result like below :

host Message

x ABC
y DEF
z HIG
Total 3
My basic search is like: index=xyz sourcetype=123 Message ="*"|stat count by host Message

Tags (2)
0 Karma
1 Solution

somesoni2
Revered Legend

Try like this

index=xyz sourcetype=123 Message ="*" | stats count by host Message | fields - count | appendpipe [|stats count as Message | eval host="Total"]

View solution in original post

niketn
Legend

A little different approach which will print row numbers against each row, but without nested Splunk search query, hence should not cause performance issue.

index=xyz sourcetype=123 Message ="*"
| stat count by host Message 
| fields - count

Save as dashboard table and set the table properties to enable Row Numbers. You can do the same by editing Dashboard XML also.

<option name="rowNumbers">true</option>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

chimell
Motivator

Hi

Try this search code :

index=xyz  sourcetype=123  Message ="*"|stats count by host  , Message |fields - count |appendcols[search index=xyz  sourcetype=123  Message ="*"|stats count as Total  ]
0 Karma

somesoni2
Revered Legend

Try like this

index=xyz sourcetype=123 Message ="*" | stats count by host Message | fields - count | appendpipe [|stats count as Message | eval host="Total"]
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...