POST /v1/logSearches

Save the log search in the content library.

Servers

Request headers

Name Type Required Description
Content-Type String Yes The media type of the request body.

Default value: "application/json"

Request body fields

Name Type Required Description
queryParameters[] Array No

Values for search template used in the search query. Learn more about the search templates here : https://help.sumologic.com/docs/search/get-started-with-search/build-search/search-templates/

queryParameters[].name String Yes

The name of the parameter.

queryParameters[].description String No

A description of the parameter.

queryParameters[].dataType String Yes

The data type of the parameter. Supported values are:

  1. NUMBER
  2. STRING
  3. ANY
  4. KEYWORD
queryParameters[].value String Yes

A value for the parameter. Should be compatible with the type set in dataType field.

parentId String Yes

Identifier of a folder where to save the log search.

name String Yes

Name of the item in the content library.

description String No

Item description in the content library.

properties String No

Aggregate Results Settings and View configurations, Legends settings, and different visualisation settings overrides. Leave this field empty to use the defaults. This property contains JSON object encoded as a string.

timeRange Object Yes
timeRange.type String Yes

Type of the time range. Value must be either CompleteLiteralTimeRange or BeginBoundedTimeRange.

schedule Object No
schedule.threshold Object No
schedule.threshold.thresholdType String No

This property is deprecated. The system will automatically infer the value of this field from the query going forward, so the user-specified value will no longer be honored. Threshold type. Possible values are:

  1. message
  2. group

Use group as threshold type if the search query is of aggregate type. For non-aggregate queries, set it to message.

schedule.threshold.operator String Yes

Criterion to be applied when comparing actual result count with expected count. Possible values are:

  1. eq
  2. gt
  3. ge
  4. lt
  5. le
schedule.threshold.count Integer Yes

Expected result count.

schedule.scheduleType String Yes

Run schedule of the scheduled search. Set to "Custom" to specify the schedule with a CRON expression.Please note that with Custom, 1Day and 1Week schedule types you need to provide the corresponding cron expression to determine when to actually run the search. e.g. Sample Valid Cron for 1Day is "0 0 16 ? * 2-6 *". Possible schedule types are:

  • RealTime
  • 15Minutes
  • 1Hour
  • 2Hours
  • 4Hours
  • 6Hours
  • 8Hours
  • 12Hours
  • 1Day
  • 1Week
  • Custom
schedule.parameters[] Array No

A list of scheduled search template parameters to be used while executing the query. This is different from the queryParameters field in parent object as this field will be used for execution as per the schedule. The parent object field is for search itself, not part of execution. Learn more about the search templates here : https://help.sumologic.com/docs/search/get-started-with-search/build-search/search-templates/

schedule.parameters[].name String Yes

Name of scheduled search parameter.

schedule.parameters[].value String Yes

Value of scheduled search parameter.

schedule.notification Object Yes
schedule.notification.taskType String Yes

Delivery channel for notifications.

schedule.displayableTimeRange String No

A human-friendly text describing the query time range. For e.g. "-2h", "last three days", "team default time". This value can not be set via API.

schedule.parseableTimeRange Object Yes
schedule.parseableTimeRange.type String Yes

Type of the time range. Value must be either CompleteLiteralTimeRange or BeginBoundedTimeRange.

schedule.cronExpression String No

Cron-like expression specifying the search's schedule. Field scheduleType must be set to "Custom", otherwise, scheduleType takes precedence over cronExpression.

schedule.timeZone String Yes

Time zone identifier for time specification. Either an abbreviation such as "PST", a full name such as "America/Los_Angeles", or a custom ID such as "GMT-8:00". Note that the support of abbreviations is for JDK 1.1.x compatibility only and full names should be used. The GMT time zone is chosen if the given time zone cannot be identified.

schedule.muteErrorEmails Boolean No

If enabled, emails are not sent out in case of errors with the search.

queryString String Yes

Query to perform.

parsingMode String No

Define the parsing mode to scan the JSON format log messages. Possible values are:

  1. AutoParse
  2. Manual In AutoParse mode, the system automatically figures out fields to parse based on the search query. While in the Manual mode, no fields are parsed out automatically. For more information see Dynamic Parsing.

Default value: "Manual"

runByReceiptTime Boolean No

This has the value true if the search is to be run by receipt time and false if it is to be run by message time.

Default value: false

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.