Skip to content

Commit 1f4eee5

Browse files
authored
Update parsing examples to use json instead of images, update ui image (#32665)
1 parent 5f9fca9 commit 1f4eee5

File tree

3 files changed

+74
-16
lines changed

3 files changed

+74
-16
lines changed

content/en/logs/log_configuration/parsing.md

Lines changed: 72 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -423,11 +423,25 @@ Note that "id" is an integer and not a string.
423423
MyParsingRule (%{integer:user.id}|%{word:user.firstname}) connected on %{date("MM/dd/yyyy"):connect_date}
424424
```
425425

426-
**Results**:
427-
428-
{{< img src="logs/processing/parsing/parsing_example_4.png" alt="Parsing example 4" style="width:80%;" >}}
429-
430-
{{< img src="logs/processing/parsing/parsing_example_4_bis.png" alt="Parsing example 4 bis" style="width:80%;" >}}
426+
**Results**:<br>
427+
`%{integer:user.id}`
428+
```json
429+
{
430+
"user": {
431+
"id": 12345
432+
},
433+
"connect_date": 1510099200000
434+
}
435+
```
436+
`%{word:user.firstname}`
437+
```json
438+
{
439+
"user": {
440+
"firstname": "john"
441+
},
442+
"connect_date": 1510099200000
443+
}
444+
```
431445

432446
### Optional attribute
433447

@@ -437,6 +451,7 @@ Some logs contain values that only appear part of the time. In this case, make a
437451

438452
```text
439453
john 1234 connected on 11/08/2017
454+
john connected on 11/08/2017
440455
```
441456

442457
**Rule**:
@@ -447,9 +462,28 @@ MyParsingRule %{word:user.firstname} (%{integer:user.id} )?connected on %{date("
447462

448463
**Note**: A rule will not match if you include a space after the first word in the optional section.
449464

450-
{{< img src="logs/processing/parsing/parsing_example_5.png" alt="Parsing example 5" style="width:80%;" >}}
465+
**Result**:<br>
466+
`(%{integer:user.id} )?`
451467

452-
{{< img src="logs/processing/parsing/parsing_example_5_bis.png" alt="Parsing example 5 bis" style="width:80%;" >}}
468+
```json
469+
{
470+
"user": {
471+
"firstname": "john",
472+
"id": 1234
473+
},
474+
"connect_date": 1510099200000
475+
}
476+
```
477+
478+
`%{word:user.firstname} (%{integer:user.id} )?`
479+
```json
480+
{
481+
"user": {
482+
"firstname": "john",
483+
},
484+
"connect_date": 1510099200000
485+
}
486+
```
453487

454488
### Nested JSON
455489

@@ -467,7 +501,17 @@ Sep 06 09:13:38 vagrant program[123]: server.1 {"method":"GET", "status_code":20
467501
parsing_rule %{date("MMM dd HH:mm:ss"):timestamp} %{word:vm} %{word:app}\[%{number:logger.thread_id}\]: %{notSpace:server} %{data::json}
468502
```
469503

470-
{{< img src="logs/processing/parsing/nested_json.png" alt="Nested JSON Parsing example" style="width:80%;" >}}
504+
**Result**:
505+
```json
506+
{
507+
"timestamp": 1567761218000,
508+
"vm": "vagrant",
509+
"app": "program",
510+
"logger": {
511+
"thread_id": 123
512+
}
513+
}
514+
```
471515

472516
### Regex
473517

@@ -483,7 +527,15 @@ john_1a2b3c4 connected on 11/08/2017
483527
MyParsingRule %{regex("[a-z]*"):user.firstname}_%{regex("[a-zA-Z0-9]*"):user.id} .*
484528
```
485529

486-
{{< img src="logs/processing/parsing/regex_parsing.png" alt="Parsing example 6" style="width:80%;" >}}
530+
**Result**:
531+
```json
532+
{
533+
"user": {
534+
"firstname": "john",
535+
"id": "1a2b3c4"
536+
}
537+
}
538+
```
487539

488540
### List to array
489541

@@ -501,7 +553,17 @@ Users [John, Oliver, Marc, Tom] have been added to the database
501553
myParsingRule Users %{data:users:array("[]",",")} have been added to the database
502554
```
503555

504-
{{< img src="logs/processing/parsing/array_parsing.png" alt="Parsing example 6" style="width:80%;" >}}
556+
**Result**:
557+
```json
558+
{
559+
"users": [
560+
"John",
561+
" Oliver",
562+
" Marc",
563+
" Tom"
564+
]
565+
}
566+
```
505567

506568
**Log**:
507569

content/en/logs/log_configuration/processors.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ In [log configuration settings][1], you can configure processors such as the [Gr
3737

3838
Create custom grok rules to parse the full message or a specific attribute of your raw event. As a best practice, limit your grok parser to 10 parsing rules. For more information on Grok syntax and parsing rules, see [Parsing][10].
3939

40-
{{< img src="logs/log_configuration/processor/grok_parser.png" alt="Grok Parser" style="width:80%;" >}}
40+
{{< img src="/logs/processing/processors/define_parsing_rules_syntax_suggestions.png" alt="Grok parser syntax suggestions in the UI" style="width:90%;" >}}
4141

4242
{{< tabs >}}
4343
{{% tab "UI" %}}
@@ -154,8 +154,6 @@ Use the [Datadog Log Pipeline API endpoint][1] with the following log date remap
154154

155155
Use the status remapper processor to assign attributes as an official status to your logs. For example, add a log severity level to your logs with the status remapper.
156156

157-
{{< img src="logs/processing/processors/log_post_severity_bis.png" alt="Log severity after remapping" style="width:40%;" >}}
158-
159157
Each incoming status value is mapped as follows:
160158

161159
* Integers from 0 to 7 map to the [Syslog severity standards][4]
@@ -289,9 +287,7 @@ Use the [Datadog Log Pipeline API endpoint][1] with the following log message re
289287

290288
## Remapper
291289

292-
The remapper processor remaps any source attribute(s) or tags to another target attribute or tag. For example, remap `user` by `firstname` to target your logs in the Log Explorer:
293-
294-
{{< img src="logs/processing/processors/attribute_post_remapping.png" alt="Attribute after remapping" style="width:60%;">}}
290+
The remapper processor remaps any source attribute(s) or tags to another target attribute or tag. For example, remap `user` by `firstname` to target your logs in the Log Explorer.
295291

296292
Constraints on the tag/attribute name are explained in the [attributes and tags documentation][5]. Some additional constraints, applied as `:` or `,`, are not allowed in the target tag/attribute name.
297293

408 KB
Loading

0 commit comments

Comments
 (0)