.conf25 registration is now open!Register today

 Code examples for SplunkJS Stack (outside Splunk Web)

    Info Circle

    Splunk is no longer actively developing new features or adding guidance to the SplunkJS stack component.

    If you develop applications using the Splunk Web Framework, Splunk encourages new development using the Splunk UI Toolkit (SUIT) instead. SUIT provides component and application development tools, visualizations, a dashboard framework, and documentation. Built with ReactJS, SUIT provides a modern approach for Splunk app front-end development, and is used across Splunk's product suite. SUIT comes with an Examples Gallery containing open-sourced applications showcasing different use cases, including dashboards, visualizations, UI components and more. To learn how to get started and to find out more about what the toolkit can support, check out the Examples Gallery in Splunk UI documentation. For more information, contact webplatform@splunk.com.

    The following JavaScript examples show how to use SplunkJS Stack in an app outside of Splunk Web to set up and work with views and search managers using the different components of the Splunk Web Framework:

    Code exampleDescription
    Login formA login form that shows how to log in to Splunk and get a session key using the Splunk Enterprise SDK for JavaScript.
    Basic pageA basic page with a chart and an events viewer displaying results from a search.
    Basic page with a layoutThe same basic page as above, but with a Splunk Dashboard (dashboard.css) layout.
    A collection of views on one pageDisplays the most common views on one page. Shows how to sync search controls to a search manager and how to populate form controls with static choices and search-based choices.
    ChartsShows examples of each of the possible chart types.
    Tables with custom renderersShows how to display a table that includes a sparkline in the search results, a custom cell renderer, and a custom row renderer.
    Events viewersShows examples of each of the possible types of events viewer.
    MapsShows the same data displayed on a Splunk map and a Google map.
    Drilldown propertiesShows the result of setting different combinations of drilldown properties for the views that allow drilldown actions.
    Search controls using tokensShows how to use tokens to sync search controls to a search manager.
    Search controls using eventsShows how to use change events to sync search controls to a search manager.
    Search progress eventsShows how to retrieve the progress of a search, including the status of the search and the properties of the search job.
    Search results modelShows how to retrieve the different types of search results from the results model: events, preview, results, and summary.