v1

latestOpenAPI 3.0.02026-08-064311,0881.3 MB
macroManagement

Create a new macro.

Creates a new macro.

post/v2/macros

Request body

descriptionstring

Description of the macro.

definitionstring required

The definition of the macro. Use a valid Sumo Log Search expression.

enabledboolean

If the macro is enabled or not (default True)

namestring required

Name of the macro.

macroCreationSuggestionIdstring

Identifier if the suggestion comes from an macro creation suggestion. This id is used to track macro creation suggestions, and to delete the suggestion once the macro is created.

Example request

{
  "description": "Macro for geo lookup.",
  "definition": "lookup latitude, longitude from geo://location on ip = {{ip_field}} | count by latitude, longitude | sort _count\"\n",
  "arguments": [
    {
      "name": "ip_field",
      "type": "String"
    }
  ],
  "argumentValidations": [
    {
      "evalExpression": "isValidIp(ip_field)",
      "errorMessage": "You need to enter a field name which is a valid ip."
    }
  ],
  "name": "MacroGeoLookup",
  "macroCreationSuggestionId": "ABC12"
}

Response

The macro has been created.

descriptionstring

Description of the macro.

definitionstring required

The definition of the macro. Use a valid Sumo Log Search expression.

enabledboolean

If the macro is enabled or not (default True)

namestring required

Name of the macro.

macroCreationSuggestionIdstring

Identifier if the suggestion comes from an macro creation suggestion. This id is used to track macro creation suggestions, and to delete the suggestion once the macro is created.

idstring required

Unique identifier for the macro. This id is used to get detailed information about the macro, such as name, definition, arguments and argument validations.

createdAtstring date-time required

Creation timestamp of the macro in UTC in RFC3339 format.

createdBystring required

The identifier of the user who created the macro.

Example response

{
  "description": "Macro for geo lookup.",
  "definition": "lookup latitude, longitude from geo://location on ip = {{ip_field}} | count by latitude, longitude | sort _count\"\n",
  "arguments": [
    {
      "name": "ip_field",
      "type": "String"
    }
  ],
  "argumentValidations": [
    {
      "evalExpression": "isValidIp(ip_field)",
      "errorMessage": "You need to enter a field name which is a valid ip."
    }
  ],
  "name": "MacroGeoLookup",
  "macroCreationSuggestionId": "ABC12",
  "id": "C03E086C137F38B4",
  "createdAt": "2024-10-01T09:10:00Z",
  "createdBy": "0000000006743FDD"
}