The Single view displays a single value based on a search manager, which can be useful for showing an aggregate value such as a stats count.
Name | Default value | Description |
id | Required. The unique ID for this control. | |
afterLabel | "" | The label to display before (to the left of) the value. |
beforeLabel | "" | The label to display after (to the right of) the value. |
classField | "" | When set to "range", works with the rangemap search command to visually convey severity (see the example below). For more on rangemap, see Using rangemap with single value panels. |
data | "preview" | The type of data to retrieve from the search results ( results | preview | events | summary | timeline ). |
field | "" | The search field to use as the display value. |
managerid | null | The ID of the search manager to bind this view to. |
underLabel | null | The label to display below the value. |
Name | Description |
render | Draws the view to the screen. Called only when you create the view manually in JavaScript. |
{% single id="example-single" managerid="example-search" beforeLabel="Event count:" %}
<script> var deps = [ "splunkjs/ready!", "splunkjs/mvc/singleview" ]; require(deps, function(mvc) { var SingleView = require("splunkjs/mvc/singleview"); // Instantiate components new SingleView({ id: "example-single", managerid: "example-search", beforeLabel: "Event count:", el: $("#mysingleview") }).render(); }); </script>