Skip to content

Commit 507b6cb

Browse files
committed
SUMO-260843: Add macro docs
1 parent 3133b1f commit 507b6cb

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

website/docs/r/macro.html.markdown

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
layout: "sumologic"
3+
page_title: "SumoLogic: sumologic_dashboard"
4+
description: |-
5+
Provides a Sumologic Dashboard (New)
6+
---
7+
8+
# sumologic_macro
9+
Provides a Sumo Logic Macro (beta).
10+
11+
## Example Usage
12+
```hcl
13+
14+
resource "sumologic_macro" "ip_macro" {
15+
name = "ip_macro"
16+
definition = "_sourceCategory=yourcategory | where ip = {{ip_address}} | timeslice 5m | count by _timeslice"
17+
argument {
18+
name = "ip_address"
19+
type = "String"
20+
}
21+
argument_validation {
22+
eval_expression = "isValidIP(ip_address)"
23+
error_message = "The ip you provided is invalid"
24+
}
25+
}
26+
```
27+
28+
## Argument reference
29+
30+
The following arguments are supported:
31+
32+
- `name` - (Required) Name of the macro.
33+
- `description` - (Optional) Description of the macro.
34+
- `definition` - (Required) The definition of your macro
35+
- `enabled` - (Optional) Whether the macro will be enabled. Default true.
36+
- `argument` - (Block List, Optional) A list of arguments for the macro. They must match the arguments in the definition. See [argument schema](#schema-for-argument) for details.
37+
- `argumentValidations` - (Block List, Optional) A list validations for the arguments in the macro. See [argumentValidation schema](#schema-for-argumentvalidation)
38+
for details.
39+
40+
## Attributes reference
41+
In addition to all arguments above, the following attributes are exported:
42+
43+
- `id` - The ID of the macro.
44+
45+
### Schema for `argument`
46+
- `name` - (Required) Name of the argument.
47+
- `type` - (Required) Type of the argument. Must be String, Any, Number or Keyword
48+
49+
### Schema for `argumentValidation`
50+
- `evalExpression` - (Required) The expression to validate a macro argument.
51+
- `errorMessage` - (Required) Error message to show when the argument validation failed.

0 commit comments

Comments
 (0)