Hi @Hajar_Lachhab Welcome to the community
You have a couple of issues... and you are running into the subtle escaping of the "
characters
%{NUMBER:response:int} %{NUMBER:response.bytes:int}
This is a fundamental issue the first sets reponse
as an int the 2nd says its an object... I fixed that.
Go to Dev Tools and try the following...
Then go look at the UI
DELETE _ingest/pipeline/discuss-test
PUT _ingest/pipeline/discuss-test
{
"processors": [
{
"grok": {
"field": "message",
"patterns": [
"%{IPORHOST:source.ip} %{USER:user.id} %{USER:user.name} \\[%{HTTPDATE:@timestamp}\\] \"%{WORD:http.request.method} %{URIPATHPARAM:request} HTTP/%{NUMBER:http.version}\" %{NUMBER:response.code:int} %{NUMBER:response.bytes:int} \"%{DATA:referrer}\" \"%{DATA:useraegent}\""
]
}
}
]
}
DELETE discuss-test
POST discuss-test/_doc?pipeline=discuss-test
{
"message": "10.0.2.4 - - [14/Mar/2023:16:12:41 +0000] \"HEAD /drupal/modules/search/tests/0302-exploits.php HTTP/1.1\" 404 139 \"-\" \"DirBuster-1.0-RC1 (http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project)\""
}
Results
{
"took": 0,
"timed_out": false,
"_shards": {
"total": 1,
"successful": 1,
"skipped": 0,
"failed": 0
},
"hits": {
"total": {
"value": 1,
"relation": "eq"
},
"max_score": 1,
"hits": [
{
"_index": "discuss-test",
"_id": "IyxfQ4cBVfQentc85xSk",
"_score": 1,
"_source": {
"request": "/drupal/modules/search/tests/0302-exploits.php",
"referrer": "-",
"useraegent": "DirBuster-1.0-RC1 (http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project)",
"@timestamp": "14/Mar/2023:16:12:41 +0000",
"response": {
"code": 404,
"bytes": 139
},
"http": {
"request": {
"method": "HEAD"
},
"version": "1.1"
},
"source": {
"ip": "10.0.2.4"
},
"message": "10.0.2.4 - - [14/Mar/2023:16:12:41 +0000] \"HEAD /drupal/modules/search/tests/0302-exploits.php HTTP/1.1\" 404 139 \"-\" \"DirBuster-1.0-RC1 (http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project)\"",
"user": {
"name": "-",
"id": "-"
}
}
}
]
}
}
Now go to the UI and Run with this document
[
{
"_source": {
"message": "10.0.2.4 - - [14/Mar/2023:16:12:41 +0000] \"HEAD /drupal/modules/search/tests/0302-exploits.php HTTP/1.1\" 404 139 \"-\" \"DirBuster-1.0-RC1 (http://www.owasp.org/index.php/Category:OWASP_DirBuster_Project)\""
}
}
]