Skip to content

Commit 4244ba0

Browse files
authored
Merge pull request #113149 from spelluru/egridfilter0428
Advanced filtering examples
2 parents caa0728 + 008e38a commit 4244ba0

File tree

1 file changed

+156
-6
lines changed

1 file changed

+156
-6
lines changed

articles/event-grid/event-filtering.md

Lines changed: 156 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ author: spelluru
66

77
ms.service: event-grid
88
ms.topic: conceptual
9-
ms.date: 01/21/2019
9+
ms.date: 04/28/2020
1010
ms.author: spelluru
1111
---
1212

@@ -93,9 +93,9 @@ If you specify multiple different filters, an **AND** operation is performed, so
9393
]
9494
```
9595

96-
### Operator
96+
### Operators
9797

98-
The available operators for numbers are:
98+
The available operators for **numbers** are:
9999

100100
* NumberGreaterThan
101101
* NumberGreaterThanOrEquals
@@ -104,17 +104,18 @@ The available operators for numbers are:
104104
* NumberIn
105105
* NumberNotIn
106106

107-
The available operator for booleans is: BoolEquals
107+
The available operator for **booleans** is:
108+
- BoolEquals
108109

109-
The available operators for strings are:
110+
The available operators for **strings** are:
110111

111112
* StringContains
112113
* StringBeginsWith
113114
* StringEndsWith
114115
* StringIn
115116
* StringNotIn
116117

117-
All string comparisons are case-insensitve.
118+
All string comparisons are **not** case sensitive.
118119

119120
### Key
120121

@@ -156,6 +157,155 @@ Advanced filtering has the following limitations:
156157

157158
The same key can be used in more than one filter.
158159

160+
### Examples
161+
162+
### StringContains
163+
164+
```json
165+
"advancedFilters": [{
166+
"operatorType": "StringContains",
167+
"key": "data.key1",
168+
"values": [
169+
"microsoft",
170+
"azure"
171+
]
172+
}]
173+
```
174+
175+
### StringBeginsWith
176+
177+
```json
178+
"advancedFilters": [{
179+
"operatorType": "StringBeginsWith",
180+
"key": "data.key1",
181+
"values": [
182+
"event",
183+
"grid"
184+
]
185+
}]
186+
```
187+
188+
### StringEndsWith
189+
190+
```json
191+
"advancedFilters": [{
192+
"operatorType": "StringEndsWith",
193+
"key": "data.key1",
194+
"values": [
195+
"jpg",
196+
"jpeg",
197+
"png"
198+
]
199+
}]
200+
```
201+
202+
### StringIn
203+
204+
```json
205+
"advancedFilters": [{
206+
"operatorType": "StringIn",
207+
"key": "data.key1",
208+
"values": [
209+
"exact",
210+
"string",
211+
"matches"
212+
]
213+
}]
214+
```
215+
216+
### StringNotIn
217+
218+
```json
219+
"advancedFilters": [{
220+
"operatorType": "StringNotIn",
221+
"key": "data.key1",
222+
"values": [
223+
"aws",
224+
"bridge"
225+
]
226+
}]
227+
```
228+
229+
### NumberIn
230+
231+
```json
232+
233+
"advancedFilters": [{
234+
"operatorType": "NumberIn",
235+
"key": "data.counter",
236+
"values": [
237+
5,
238+
1
239+
]
240+
}]
241+
242+
```
243+
244+
### NumberNotIn
245+
246+
```json
247+
"advancedFilters": [{
248+
"operatorType": "NumberNotIn",
249+
"key": "data.counter",
250+
"values": [
251+
41,
252+
0,
253+
0
254+
]
255+
}]
256+
```
257+
258+
### NumberLessThan
259+
260+
```json
261+
"advancedFilters": [{
262+
"operatorType": "NumberLessThan",
263+
"key": "data.counter",
264+
"value": 100
265+
}]
266+
```
267+
268+
### NumberGreaterThan
269+
270+
```json
271+
"advancedFilters": [{
272+
"operatorType": "NumberGreaterThan",
273+
"key": "data.counter",
274+
"value": 20
275+
}]
276+
```
277+
278+
### NumberLessThanOrEquals
279+
280+
```json
281+
"advancedFilters": [{
282+
"operatorType": "NumberLessThanOrEquals",
283+
"key": "data.counter",
284+
"value": 100
285+
}]
286+
```
287+
288+
### NumberGreaterThanOrEquals
289+
290+
```json
291+
"advancedFilters": [{
292+
"operatorType": "NumberGreaterThanOrEquals",
293+
"key": "data.counter",
294+
"value": 30
295+
}]
296+
```
297+
298+
### BoolEquals
299+
300+
```json
301+
"advancedFilters": [{
302+
"operatorType": "BoolEquals",
303+
"key": "data.isEnabled",
304+
"value": true
305+
}]
306+
```
307+
308+
159309
## Next steps
160310

161311
* To learn about filtering events with PowerShell and Azure CLI, see [Filter events for Event Grid](how-to-filter-events.md).

0 commit comments

Comments
 (0)