Question

We have Kibana setup to search for about 50 different terms in our logs. Unfortunately, that displays each of these query's aliases in the legend very messily as we have 50 terms stacked on top of each other. I know it is possible to hide the legend all together but I'd like to have the individual counts on the UI (similar to Splunk). Is there a way to use the Filters to only include queries that are greater than 0? Or is it possible to edit the legend itself to hide any queries that have 0 results? Thanks

Was it helpful?

Solution

This is not possible with the current release of kibana (v3.1.0)

I imagine that you are talking about the histogram panel. You could customize your Kibana code to hide any query that has 0 hits from the histogram panel legend.

This would be the file and line to change: https://github.com/elasticsearch/kibana/blob/c19105cf3f2dbefe7aa41caebca5bcf40efff3b7/src/app/panels/histogram/module.html#L55

From:

<span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend">
  <i class='icon-circle' ng-style="{color: series.query.color}"></i>
  <span class='small histogram-legend-item'>
    <span ng-if="panel.show_query">{{series.query.alias || series.query.query}}</span>
    <span ng-if="!panel.show_query">{{series.query.alias}}</span>
    <span ng-show="panel.legend_counts"> ({{series.hits}})</span>
  </span>
</span>

To:

<span ng-show="panel.legend" ng-repeat='series in legend' class="histogram-legend">
  <span ng-show='series.hits > 0'>
      <i class='icon-circle' ng-style="{color: series.query.color}"></i>
      <span class='small histogram-legend-item'>
        <span ng-if="panel.show_query">{{series.query.alias || series.query.query}}</span>
        <span ng-if="!panel.show_query">{{series.query.alias}}</span>
        <span ng-show="panel.legend_counts"> ({{series.hits}})</span>
      </span>
  </span>
</span>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top