{% load splunkmvc %} Splunk Application Framework Quick Start
Back Next

Splunk Application Framework Quick Start

Add a search bar to your app

A quick and easy way to add dynamic search functionality to your app is by using a SearchBar view.

Add a search bar

The search bar is a standard view that includes a text input for entering search queries and (optionally) a time range input that allows the user to change the search timeline. The ID of the search manager to bind to is set in the SearchBar properties. When a new search query or timeline is submitted, the search manager is updated and any other views that are bound to the search manager are notified.

Here is a basic search bar (although this won't do anything yet):

{% searchbar id="example search bar" managerid="example-search" %} {% searchmanager id="example-search" %}

Create the view by adding the searchbar tag to your HTML template, including the ID of the search manager in the managerid property.

{% searchbar id="example search bar" managerid="example-search" %}

{% searchmanager id="example-search" %} 

Search bars can also be bound to and modify an existing hard-coded search.

Learn more about hard-coded searches

Back Next
{% component_loader %}