the output of this request: GET /logs-imen/search is : { "took": 1, "timedout": false,…
- User
the output of this request: GET /logs-imen/_search is : { "took": 1, "timed_out": false, "_shards": { "total": 1, "successful": 1, "skipped": 0, "failed": 0 }, "hits": { "total": { "value": 1000, "relation": "eq" }, "max_score": 1, "hits": [ { "_index": "logs-imen", "_id": "GO__548B0bQ7XMtSlxws", "_score": 1, "_source": { "column1": 0, "Log Message": "draw back payment, userId: 4d2a46c7-71cb-4cf1-b5bb-b68406d9da6f, money: 0", "Trace ID": "a8ac2bc13e5c423d83743ee2d661482b.40.16288839234110001", "Log Level": "INFO", "Index": 40, "Timestamp": "2021-08-14 03:45:27.613", "Service Name": "ts-inside-payment-service", "Processed Log Message": "draw back payment userid 4d2a46c771cb4cf1b5bbb68406d9da6f money 0", "IP Address": "10.244.2.153", "@timestamp": "2021-08-14T03:45:27.613+01:00", "Thread Name": "http-nio-18673-exec-3", "Session ID": "882525b0797d402abad01f319ebea084", "Span ID": "e011366013074feda29701dc14e41305", "Mapped Log Level": 0, "Logger Name": "i.controller.InsidePaymentController" } }} how to make a pipeline in elastic search to process the log message to lowercase it and remove unnecessary tokens :
Click the Variables button, above, to create your own variables.
PUT /logs_analyzer { "settings": { "analysis": { "analyzer": { "my_custom_analyzer": { "type": "custom", "tokenizer": "standard", "char_filter": [ "html_strip" ], "filter": [ "lowercase" ] } } } } }
PUT /_ingest/pipeline/my_text_processor_pipeline { "description": "Preprocess text fields", "processors": [ { "lowercase": { "field": "Log Message" } } ] }
GET /logs-imen/_search
POST /logs-imen/_doc/1?pipeline=my_text_processor_pipeline { "test": "Some Text DATA. PSPSPSPSP" } edit this
- Assistant
- User
{ "error": { "root_cause": [ { "type": "script_exception", "reason": "runtime error", "script_stack": [ "ctx.LogMessage = ctx.LogMessage.replaceAll('[^a-zA-Z0-9 ]', '')", " ^---- HERE" ], "script": "ctx.LogMessage = ctx.LogMessage.replaceAll('[^a-zA-Z0-9 ]', '')", "lang": "painless", "position": { "offset": 31, "start": 0, "end": 63 } } ], "type": "script_exception", "reason": "runtime error", "script_stack": [ "ctx.LogMessage = ctx.LogMessage.replaceAll('[^a-zA-Z0-9 ]', '')", " ^---- HERE" ], "script": "ctx.LogMessage = ctx.LogMessage.replaceAll('[^a-zA-Z0-9 ]', '')", "lang": "painless", "position": { "offset": 31, "start": 0, "end": 63 }, "caused_by": { "type": "null_pointer_exception", "reason": "cannot access method/field [replaceAll] from a null def reference" } }, "status": 400 }
- Assistant