Splunk Search

Stats Count in InputLookup?

zward
Path Finder

Hello,

I am working on a dashboard panel and I am at my wits end on how I can create a table entry for the eventcount or stats of the number of events. I am able to display my entire dashboard minus the eventcount (I need a full count of the number of events for the specific host), however when I attempt to use eventcount, it fails as it is not the first entry into the search, and stats dc(index) is not populating the search either and it ends up blank. Any thoughts on how I can get an event count for the particular host to display in my inputlookup dashboard? I am hoping it is an easy fix, but something just isn't adding up.

Thank you.

:

<panel>
  <title>Results</title>
  <input type="dropdown" token="fields" searchWhenChanged="true">
    <label>Field Selection:</label>
    <choice value="table host, sourcetype, index, firstTime, lastTime, recentTime, lastUpdated | sort - host">All</choice>
    <choice value="dedup index, sourcetype | table index, sourcetype">Indexes, Sourcetypes Only</choice>
    <choice value="table host, sourcetype, index">Indexes, Sourcetypes, Hosts Only</choice>
    <default>table host, sourcetype, index, firstTime, lastTime, recentTime, lastUpdated | sort - host</default>
  </input>
  <table>
    <search>
      <query>| inputlookup MCInventory  where index=$index$ sourcetype=$sourcetype$ host=$host$ | $filter$  | convert ctime(recentTime) ctime(firstTime) ctime(lastTime) ctime(lastUpdated) | $fields$</query>
      <earliest>-24h@h</earliest>
      <latest>now</latest>
    </search>
    <option name="wrap">true</option>
    <option name="rowNumbers">false</option>
    <option name="dataOverlayMode">heatmap</option>
    <option name="drilldown">row</option>
    <option name="count">50</option>
  </table>
</panel>
0 Karma

cmerriman
Super Champion

how are those tokens in the search query created? are all the tokens working properly? and where are you looking at dc(index) or calculating an eventcount? I think the whole xml might be more helpful

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Agentic Operations Start with Context: Build the Right Data Foundation

Agentic Operations Start with Context: Build the Right Data Foundation   By Courtney Wright, Product Marketing ...

Assisted, Augmented or Agentic? Choose Your Splunk Starting Point

Assisted, Augmented or Agentic? Choose Your Splunk Starting Point   By Courtney Wright, Product Marketing ...

Session 2 | Beyond the Thread: Operationalizing AI with Confidence

Session 2   Beyond the Thread: Operationalizing AI with Confidence    The true power of the Cisco Data Fabric ...