Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to define an Elasticsearch index for logs with a timestamp field.
Elasticsearch
{
"mappings": {
"properties": {
"timestamp": { "type": [1] }
}
}
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'text' or 'keyword' type for timestamp fields.
Using 'integer' type for dates.
✗ Incorrect
The timestamp field should be of type 'date' to store time values correctly.
2fill in blank
mediumComplete the pipeline processor to parse a JSON log message.
Elasticsearch
{
"processors": [
{
"json": {
"field": [1]
}
}
]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Parsing the wrong field like 'timestamp' or 'source'.
Forgetting to quote the field name.
✗ Incorrect
The JSON processor parses the 'message' field containing the JSON log string.
3fill in blank
hardFix the error in the ingest pipeline to add a new field with a static value.
Elasticsearch
{
"processors": [
{
"set": {
"field": "log_level",
"value": [1]
}
}
]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted strings causing JSON errors.
Using single quotes instead of double quotes.
✗ Incorrect
The value must be a string, so it needs to be quoted with double quotes.
4fill in blank
hardFill both blanks to create a pipeline that drops logs with level 'debug'.
Elasticsearch
{
"processors": [
{
"drop": {
"if": "ctx.[1] == '[2]'"
}
}
]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong field names like 'level'.
Checking for 'info' instead of 'debug'.
✗ Incorrect
The condition checks if 'log_level' equals 'debug' to drop those logs.
5fill in blank
hardFill all three blanks to create a pipeline that renames 'host' to 'hostname', adds a tag, and removes 'temp_field'.
Elasticsearch
{
"processors": [
{
"rename": {
"field": [1],
"target_field": [2]
}
},
{
"append": {
"field": "tags",
"value": [[3]]
}
},
{
"remove": {
"field": "temp_field"
}
}
]
} Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting field names and tag values.
Using wrong tag values like 'temp'.
✗ Incorrect
Rename 'host' to 'hostname', add tag 'processed', and remove 'temp_field'.