Skip to content

Commit b746445

Browse files
committed
fix style and convention related errors
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
1 parent b490e1f commit b746445

File tree

1 file changed

+32
-31
lines changed
  • _tuning-your-cluster/availability-and-recovery/workload-management

1 file changed

+32
-31
lines changed

_tuning-your-cluster/availability-and-recovery/workload-management/autotagging.md

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,30 @@ parent: Workload management
66
grand_parent: Availability and recovery
77
---
88

9-
# Rule-based Auto-tagging in OpenSearch
9+
# Rule-based auto-tagging in OpenSearch
10+
In this guide we will walk you through how to use the rule based auto-tagging. Auto-tagging enriches the request with the target label which a consuming feature (such as workload-management) consumes.
11+
## What is rule-based auto-tagging?
1012

11-
## What is Rule-based Auto-tagging?
13+
Rule-based Auto-tagging automatically assigns workload groups to incoming search requests in OpenSearch. This feature helps you implement automated feature policies without manual intervention.
14+
throughout this guide I will take a sample feature which uses rule framework for auto-tagging i,e; workload-management
1215

13-
Rule-based Auto-tagging automatically assigns workload groups to incoming search requests in OpenSearch. This feature helps you implement automated workload management policies without manual intervention.
14-
15-
## Key Concepts
16+
## Key concepts
1617

1718
- **Rule**: Defines criteria for tagging search requests
18-
- **Index Pattern**: Prefix-based pattern matching target indices (e.g., "logs-*")
19-
- **Workload Group**: Label assigned to requests for workload management
19+
- **Attributes**: Prefix-based pattern matching for the given attribute value (e.g., attribute could be index pattern, security context values such as username, role, group etc.)
20+
- **Label**: Label assigned to requests for the client feature (e,g; workload management feature will use 'workload_group' as label)
2021
- **Auto-tagging**: Process of assigning workload groups based on rules
2122
- **Pattern Specificity**: More specific patterns take precedence e,g; `logs-prod-2025` will match `logs-prod-*` pattern over `logs-*`
2223

23-
## How to Set Up Rule-based Auto-tagging
24+
## How to set up rule-based auto-tagging
25+
Now we will learn about how can we set up the auto-tagging in opensearch.
2426

25-
### Before You Begin
27+
### Before you begin
2628

27-
- Ensure you have an OpenSearch cluster with the workload-management plugin installed
29+
- Ensure you have an OpenSearch cluster with the feature (e,g; workload-management uses this framework for autotagging) plugin installed
2830
- Verify you have administrative access to the cluster
2931

30-
### Managing Rules
32+
### Managing rules
3133

3234
Create or update a rule:
3335
```http
@@ -49,33 +51,33 @@ Delete a rule:
4951
DELETE /_rules/workload_group/{rule_id}
5052
```
5153

52-
### Rule Structure
54+
### Rule structure
5355
```json
5456
{
5557
"_id": "fwehf8302582mglfio349==", // System-generated
56-
"description": "Assign Query Group for Index Logs123",
58+
"description": "Assign Workload Group for Index Logs123",
5759
"index_pattern": ["logs123"], // Exact match or prefix pattern only
5860
"workload_group": "dev_workload_group_id",
5961
"updated_at": "01-10-2025T21:23:21.456Z" // System-generated timestamp
6062
}
6163
```
6264

63-
## How Pattern Matching Works
65+
## How pattern matching works
6466

65-
### Supported Pattern Types
67+
### Supported pattern types
6668

6769
1. Exact matches: `logs-2025-04`
6870
2. Prefix patterns: `logs-2025-*`
6971

70-
Note: OpenSearch doesn't support suffix patterns (`*-logs`) or generic patterns (`*-logs-*`).
72+
Note: This feature doesn't support suffix patterns (`*-logs`) or generic patterns (`*-logs-*`).
7173

72-
### Pattern Precedence
74+
### Pattern precedence
7375

7476
1. Exact matches have highest priority
7577
2. Longer prefix patterns take precedence over shorter ones
7678
Example: `logs-prod-2025-*` is more specific than `logs-prod-*`
7779

78-
### Evaluation Process
80+
### Evaluation process
7981

8082
1. OpenSearch receives a search request
8183
2. The system compares request indices against defined rules
@@ -84,7 +86,7 @@ Note: OpenSearch doesn't support suffix patterns (`*-logs`) or generic patterns
8486

8587
## Examples
8688

87-
### Production vs Development Logs
89+
### Production vs development logs
8890

8991
```json
9092
// Rule 1: Production Logs
@@ -110,7 +112,7 @@ GET /logs-dev-2025/_search
110112
// Result: Tagged with "development"
111113
```
112114

113-
### Handling Specificity
115+
### Handling specificity
114116

115117
```json
116118
// Rule 1: General Logs
@@ -132,26 +134,25 @@ GET /logs-prod-service-2025/_search
132134
// Result: Tagged with "prod_service" (more specific match wins)
133135
```
134136

135-
## Benefits of Rule-based Auto-tagging
137+
## Benefits of rule-based auto-tagging
136138

137139
- Automates request tagging
138140
- Ensures consistent policy application
139-
- Scales to new indices automatically
141+
- Scales to new attributes automatically
140142
- Reduces administrative overhead
141143
- Minimizes manual errors
142-
- Centralizes workload management
143144
- Allows easy policy updates
144145

145-
## Best Practices
146+
## Best practices
147+
The following best practices will help you familiarize with correct usage and avoid common pitfalls
146148

147-
### Designing Rules
149+
### Designing rules
148150

149151
1. Use specific prefix patterns for precise control
150152
2. Clearly document each rule's purpose
151-
3. Use consistent workload group naming
152-
4. Create a hierarchical pattern structure
153+
3. Create a hierarchical pattern structure
153154

154-
### Creating Patterns
155+
### Creating patterns
155156

156157
1. Start with the most specific patterns needed
157158
2. Use consistent delimiters in index names
@@ -169,14 +170,14 @@ GET /logs-prod-service-2025/_search
169170

170171
**Common issues and solutions:**
171172

172-
1. **No Workload Group Assigned**: Ensure your index pattern is a valid prefix
173-
2. **Unexpected Workload Group**: Look for more specific matching patterns
173+
1. **No Label Assigned**: Ensure your index pattern is a valid prefix
174+
2. **Unexpected Feature Label**: Look for more specific matching patterns
174175
3. **Rule Not Working**: Verify the pattern follows the prefix-only format
175176

176177
**To validate your setup:**
177178

178179

179180
- Test new rules with sample requests before production use
180181
- Use the list rules API to verify pattern matching
181-
- Check your logs for rule evaluation results
182+
- Check the consuming feature specific logs/stats to verify the correctness
182183

0 commit comments

Comments
 (0)