PostProcessManager

Description

The PostProcess manager encapsulates a post-process search job, which is based on a main reporting search.

Documentation

Library path

Properties

Name

Default value

Description

id Required. The unique ID for this control.
manageridnullThe ID of the search manager (the base search) to bind this control to.
search""The post-process search query.

Search properties

Name

Description

auto_cancelThe number of seconds of inactivity after which to automatically cancel a job. 0 means never auto-cancel.
auto_finalize_ecThe number of events to process after which to auto-finalize the search. 0 means no limit.
auto_pauseThe number of seconds of inactivity after which to automatically pause a job. 0 means never auto-pause.
earliest_timeA time string that specifies the earliest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string. For a real-time search, specify "rt".
enable_lookupsA Boolean that indicates whether to apply lookups to events.
exec_modeAn enum value that indicates the search mode ("blocking", "oneshot", or "normal").
force_bundle_replicationA Boolean that indicates whether this search should cause (and wait depending on the value of "sync_bundle_replication") bundle synchronization with all search peers.
idA string that contains a search ID. If unspecified, a random ID is generated.
labelA custom name created for this search.
latest_timeA time string that specifies the latest time in the time range to search. The time string can be a UTC time (with fractional seconds), a relative time specifier (to now), or a formatted time string. For a real-time search, specify "rt".
max_countThe number of events that can be accessible in any given status bucket.
max_timeThe number of seconds to run this search before finalizing. Specify 0 to never finalize.
namespaceA string that contains the application namespace in which to restrict searches.
nowA time string that sets the absolute time used for any relative time specifier in the search.
preview Indicates if preview is enabled for this search job. By default, preview is enabled for realtime searches and for searches where status_buckets > 0. Set to false to disable preview.
reduce_freqThe number of seconds (frequency) to run the MapReduce reduce phase on accumulated map values.
reload_macrosA Boolean that indicates whether to reload macro definitions from the macros.conf configuration file.
remote_server_listA string that contains a comma-separated list of (possibly wildcarded) servers from which to pull raw events. This same server list is used in subsearches.
required_field_list Deprecated. Use "rf" instead.
rfA string that adds one or more required fields to the search.
rt_blockingA Boolean that indicates whether the indexer blocks if the queue for this search is full. For real-time searches.
rt_indexfilterA Boolean that indicates whether the indexer pre-filters events. For real-time searches.
rt_maxblocksecsThe number of seconds indicating the maximum time to block. 0 means no limit. For real-time searches with "rt_blocking" set to "true".
rt_queue_sizeThe number indicating the queue size (in events) that the indexer should use for this search. For real-time searches.
search_listenerA string that registers a search state listener with the search. Use the format: search_state;results_condition;http_method;uri;
search_modeAn enum value that indicates the search mode ("normal" or "realtime"). If set to "realtime", searches live data. A real-time search is also specified by setting "earliest_time" and "latest_time" properties to "rt", even if the search_mode is normal or is not set.
spawn_processA Boolean that indicates whether to run the search in a separate spawned process. Searches against indexes must run in a separate process.
status_bucketsThe maximum number of status buckets to generate. 0 means to not generate timeline information.
sync_bundle_replicationA Boolean that indicates whether this search should wait for bundle replication to complete.
time_formatA string that specifies the format to use to convert a formatted time string from {start,end}_time into UTC seconds.
timeoutThe number of seconds to keep this search after processing has stopped.

Methods

Name

Description

cancelCancels the search job.
dataReturns the results model.
finalizeFinalizes the search job.
pausePauses the search job.
startSearchCreates the search job.
unpauseResumes the search job.

Events

Name

Description

search:cancelledFired when the search is cancelled. Changing the properties of the search starts a new one, which may cancel an old search.
search:doneFired when the search has finished. Note that this event is never fired for a real-time search.
search:errorFired when an error occurs, such as when the user does not provide a search query, the user does not provide a valid name of a saved search, or when a network failure occurs.
search:failedFired when the search job fails.
search:progressFired to indicate search progress.
search:startFired when the search is successfully started.

Example (Django tag)

{% searchmanager
    id="main-search"
    search="index=_internal sourcetype=* | head 1000 | stats count by sourcetype"
    preview=True
    cache=True %}

{% postprocessmanager
    id="postproc1"
    managerid="main-search"
    search="search sourcetype=splunkd_access OR sourcetype=splunkd" %}

{% postprocessmanager
    id="postproc2"
    managerid="main-search"
    search="search sourcetype=splunk_web_access OR sourcetype=splunk_web_service" %}

Example (JavaScript)

<script>
    var deps = [
        "splunkjs/ready!",
        "splunkjs/mvc/searchmanager",
        "splunkjs/mvc/postprocessmanager"
    ];
    require(deps, function(mvc) {
        var SearchManager = require("splunkjs/mvc/searchmanager");
        var PostProcessManager = require("splunkjs/mvc/postprocessmanager");

        // Create managers
        new SearchManager({
            id: "main-search",
            preview: true,
            cache: true,
            search: "index=_internal sourcetype=* | head 1000 | stats count by sourcetype" 
        });

        new PostProcessManager({
            id: "postproc1",
            managerid: "main-search",
            search: "search sourcetype=splunkd_access OR sourcetype=splunkd" 
        });

        new PostProcessManager({
            id: "postproc2",
            managerid: "main-search",
            search: "search sourcetype=splunk_web_access OR sourcetype=splunk_web_service" 
        });

    });
</script>

Code examples