> ## 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.

# Create And Run Search Job

Create a new search job and retrieve its messages and records. The job is deleted upon successful data retrieval.

**Important Note:** The action returns all the messages and records using pagination, so the returned warning and fields of both the records and messages will be taken from the first request to each corresponding endpoint.

For more information about required roles, please visit [Sumo Logic's documentation](https://www.sumologic.com/help/docs/api/search-job/#required-role-capabilities).

<Note>
  External Documentation

  To learn more, visit the [Sumo Logic documentation](https://www.sumologic.com/help/docs/api/search-job/#create-a-search-job).
</Note>

## Parameters

<div className="integrations-table">
  | Parameter              | Description                                                                                                                                                                                                                                                                                                                                                                                                                                          |
  | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Auto Parsing Mode      | The mode of auto-parsing.<br /><br />- `AutoParse` - Sumo Logic will perform field extraction on JSON log messages when you run a search.<br /><br />- `Manual` - (Default value) Sumo Logic will not automatically parse JSON logs at search time.<br /><br />For more information refer to the [Dynamic Parsing](https://help.sumologic.com/docs/search/get-started-with-search/build-search/dynamic-parsing/) page in Sumo Logic's documentation. |
  | From                   | The date and time at which to start the search job.                                                                                                                                                                                                                                                                                                                                                                                                  |
  | Query                  | The actual search expression.<br /><br />For more information please refer to [Sumo Logic's documentation](https://www.sumologic.com/help/docs/api/search-job/#create-a-search-job).                                                                                                                                                                                                                                                                 |
  | Search By Receipt Time | Select to search data based on the receipt time. <br /><br />For more information please refer to [Sumo Logic documentation](https://www.sumologic.com/help/docs/search/get-started-with-search/build-search/use-receipt-time/).                                                                                                                                                                                                                     |
  | Time Zone              | The time zone for the `From` and `To` parameters.<br /><br />For a list of supported time zones, refer to [Wikipedia's Time Zones article](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) under the `TZ identifier` column.                                                                                                                                                                                                           |
  | To                     | The date and time at which to end the search job.                                                                                                                                                                                                                                                                                                                                                                                                    |
</div>

## Example Output

```json theme={"dark"}
{
	"messages_warning": "",
	"messages_fields": [
		{
			"name": "_orgid",
			"fieldType": "string",
			"keyField": false
		}
	],
	"messages": [
		{
			"map": {
				"_blockid": "-1925440348082057768",
				"_collector": "ELAD COLLECTOR",
				"_collectorid": "333465271",
				"_format": "t:fail:o:-1:l:0:p:null",
				"_messagecount": "0",
				"_messageid": "-8685697174135252760",
				"_messagetime": "1769089999193",
				"_orgid": "0000000000BDA330",
				"_raw": "{\"marker\":\"ELAD_SEARCHJOB_TEST\",\"message_id\":\"msg-002\",\"tenant_id\":\"t-123\",\"text\":\"hello\"}",
				"_receipttime": "1769089999193",
				"_searchabletime": "1769090124627",
				"_size": "90",
				"_source": "elad logs and metrics",
				"_sourcecategory": "Http Input",
				"_sourcehost": "199.203.9.196",
				"_sourceid": "2074057758",
				"_sourcename": "Http Input",
				"_view": "",
				"elad": "elad"
			}
		}
	],
	"records_warning": "",
	"records_fields": [
		{
			"name": "_sourcecategory",
			"fieldType": "string",
			"keyField": true
		}
	],
	"records": [
		{
			"map": {
				"_count": "10",
				"_sourcecategory": "Http Input"
			}
		}
	]
}
```

## Workflow Library Example

[Create and Run Search Job with Sumo Logic and Send Results Via Email](https://library.blinkops.com/workflows/create-and-run-search-job-with-sumo-logic-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/create-and-run-search-job-with-sumo-logic-and-send-results-via-email/canvas" />
</div>
