> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Search

Create a new Search Job based on a search query string, and get the search results.

**Note**: If the search time reaches the action timeout limit, the action will return a timeout error and the search job ID.

You can then use the returned `SID` with actions like `Get Search Job By ID` to check the job’s status (available under the `entry.content.dispatchState` key).

Once the status is `DONE`, you can retrieve the results using the `Get Search Job Results` action.

## Basic Parameters

<div className="integrations-table">
  | Parameter           | Description                                                                                                                                                                       |
  | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Ad Hoc Search Level | The search level of the created search. For more information, refer to the [Splunk Documentation](https://docs.splunk.com/Documentation/Splunk/9.0.4/Search/Changethesearchmode). |
  | Earliest Time       | Specify a time string to set the inclusive start of the search.                                                                                                                   |
  | Execution Mode      | Set to `normal`, in order to run an asynchronous search.<br /><br />Set to `blocking`, in order to return the sid when the job is complete.                                       |
  | Latest Time         | Specify a time string to set the inclusive end of the search.                                                                                                                     |
  | Output Mode Results | Specify the format for the returned output.                                                                                                                                       |
  | Search Mode         | Set to `realtime` to search live incoming data, or `normal` to run a one-time search over historical indexed data.                                                                |
  | Search Query        | The search query the created job will run.                                                                                                                                        |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter               | Description                                                                                   |
  | ----------------------- | --------------------------------------------------------------------------------------------- |
  | Add Summary To Metadata | Select to include field summary statistics in the response.                                   |
  | Custom ID               | Optional string to specify the search ID (`<sid>`). If unspecified, a random ID is generated. |
</div>

## Example Output

```json theme={"dark"}
{
	"fields": [
		{
			"name": "<string>"
		}
	],
	"highlighted": {},
	"init_offset": 1,
	"messages": [],
	"preview": false,
	"results": [
		{
			"ClientIP": "<string>"
		}
	],
	"sid": "<string>"
}
```

## Workflow Library Example

[Run Search with Splunk and Send Results Via Email](https://library.blinkops.com/workflows/run-search-with-splunk-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/run-search-with-splunk-and-send-results-via-email/canvas" />
</div>
