Skip to content

Commit 98bff1f

Browse files
author
Pierre Guceski
authored
Merge pull request DataDog#7031 from DataDog/gus/layout-fix
Fixing layout
2 parents 6cc2588 + 5ee71c1 commit 98bff1f

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

content/en/agent/logs/advanced_log_collection.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,31 @@ logs:
106106

107107
**Note**: With Agent version 7.17+, the `replace_placeholder` string can expand references to capture groups such as `$1`, `$2` and so forth. If you want a string to follow the capture group with no space in between, use the format `${<GROUP_NUMBER>}`. For instance, to scrub user information from the log `User email: [email protected]`, the following configuration:
108108

109-
```
110-
(...)
109+
```yaml
110+
# (...)
111111
pattern: "(User email: )[^@]*@(.*)"
112112
replace_placeholder: "$1 masked_user@${2}"
113113
```
114114

115115
Would send the following log to Datadog: `User email: [email protected]`
116116

117-
###Commonly Used Log Processing Rules
117+
### Commonly Used Log Processing Rules
118118

119-
**Generic String: "sensitive-info"**
119+
##### Generic String: "sensitive-info"
120120

121121
Lines containing the string `sensitive-info` are not sent to Datadog.
122122

123-
```
123+
```yaml
124124
- type: exclude_at_match
125125
name: exclude_sensitive_info
126126
pattern: (?:sensitive\-info)
127127
```
128128

129-
**my_key=value**
129+
##### my_key=value
130130

131131
When the string "my_key=" is found, letters, numbers, spaces, and underscores following the string are redacted with `my_key=[VALUE REDACTED]`.
132132

133-
```
133+
```yaml
134134
- type: mask_sequences
135135
name: redact_key_match_letters_numbers_spaces_unders
136136
replace_placeholder: "my_key=[VALUE REDACTED]"
@@ -139,84 +139,84 @@ When the string "my_key=" is found, letters, numbers, spaces, and underscores fo
139139

140140
When the string "my_key=" is found, all characters following the string until the next period are redacted with `my_key=[VALUE REDACTED]`.
141141

142-
```
142+
```yaml
143143
- type: mask_sequences
144144
name: redact_key_match_to_period
145145
replace_placeholder: "my_key=[VALUE REDACTED]"
146146
pattern: (?:my_key=[^.])
147147
```
148148

149-
**SSN**
149+
##### Social Ssecurity Numbers
150150

151151
Redact Social Security Numbers.
152152

153-
```
153+
```yaml
154154
- type: mask_sequences
155155
name: social_security_number_basic
156156
pattern: (?:\d{3}-?\d{2}-?\d{4})
157157
replace_placeholder: "[SSN REDACTED]"
158158
```
159159

160-
**Email Address**
160+
##### Email Address
161161

162162
Redact email addresses using the RFC 5322 regex specification.
163163

164-
```
164+
```yaml
165165
- type: mask_sequences
166166
name: RFC_5322_email
167167
pattern: (?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])
168168
replace_placeholder: "[EMAIL REDACTED]"
169169
```
170170
171-
**Credit Card (Visa, MC, AMEX, DINERS, DISCOVER, JCB)**
171+
##### Credit Card (Visa, MC, AMEX, DINERS, DISCOVER, JCB)
172172
173173
Redact credit card numbers for Visa, Mastercard, American Express, Diner's Club, Discover Card, and JCB.
174174
175-
```
175+
```yaml
176176
- type: mask_sequences
177177
name: visa_mc_amex_diners_discover_jcb_credit_card
178178
replace_placeholder: "[CREDIT CARD REDACTED]"
179179
pattern: (?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\d{3})\d{11})
180180
```
181181
182-
**Postal Codes**
182+
##### Postal Codes
183183
184184
Redact postal codes (US).
185185
186-
```
186+
```yaml
187187
- type: mask_sequences
188188
name: postal_codes
189189
replace_placeholder: "[POSTAL CODE REDACTED]"
190190
pattern: (?:\d{5}-\d{4}|\d{5}|[A-Z]\d[A-Z] \d[A-Z]\d)
191191
```
192192
193-
**Between Parentheses**
193+
##### Between Parentheses
194194
195195
Redact characters after string `ExampleConfig(` until the closing paranthesis.
196196

197-
```
197+
```yaml
198198
- type: mask_sequences
199199
name: Example_config_redaction
200200
replace_placeholder: "ExampleConfig([REDACTED, REDACTED]"
201201
pattern: (?:ExampleConfig\([^\)]+)
202202
```
203203

204-
**Between Brackets**
204+
##### Between Brackets
205205

206206
Redact characters after string `on Example [` until the closing bracket.
207207

208-
```
208+
```yaml
209209
- type: mask_sequences
210210
name: on_Example_redaction
211211
replace_placeholder: "on Example [Example REDACTED]"
212212
pattern: (?:on Example\s?[^\s]+)
213213
```
214214

215-
**Class A IP Address**
215+
##### Class A IP Address
216216

217-
Redact Class A IP Addresses, range 1.0.0.1 to 126.255.255.254.
217+
Redact Class A IP Addresses, range 1.0.0.1 to 126.255.255.254.
218218

219-
```
219+
```yaml
220220
- type: mask_sequences
221221
name: simple_ip_address
222222
replace_placeholder: "[IP REDACTED]"

0 commit comments

Comments
 (0)