HI Stephenb,
Thank you for the reply i changed the pipeline code a bit but the still see the error in my script sectipn below is the ingest pipeline code
PUT _ingest/pipeline/transfer-pipeline/
{
"description" : "transfer of ownership logs",
"processors" : [
{
"set": {
"field": "request_time",
"value": "{{_source.request_time}}"
}
},
{
"set": {
"field": "response_time",
"value":"{{_source.response_time}}"
}
},
{
"date":{
"if": "ctx.request_time != null",
"field":"request_time",
"formats":["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"]
}
},
{
"date":{
"if":"ctx.response_time != null",
"field":"response_time",
"formats":["yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"]
}
},
{
"script": {
"lang": "painless",
"source": """
String datetime = ctx['request_time'];
ZonedDateTime zdt = ZonedDateTime.parse(datetime);
String datetime_new = ctx['response_time'];
ZonedDateTime edt = ZonedDateTime.parse(datetime_new);
long request_time_milli = zdt.toInstant().toEpochMilli();
ctx['request_time_milli']= request_time_milli;
long response_time_milli = edt.toInstant().toEpochMilli();
ctx['response_time_milli']= response_time_milli;
if (response_time_milli >= request_time_milli)
{
ctx['duration'] = (ctx['response_time_milli'] - ctx['request_time_milli']);
}
"""
}
}
here is the error which i see
"script"=>"\n \n String datetime = ctx['request_time'];\nZonedDateTime zdt = ZonedDateTime.parse(datetime);\nString datetime_new = ctx['response_time'];\nZonedDateTime edt = ZonedDateTime.parse(datetime_new);\n\nlong request_time_milli = zdt.toInstant().toEpochMilli();\nctx['request_time_milli']= request_time_milli;\n\nlong response_time_milli = edt.toInstant().toEpochMilli();\nctx['response_time_milli']= response_time_milli;\nif (response_time_milli >= request_time_milli)\n{\n ctx['duration'] = (ctx['response_time_milli'] - ctx['request_time_milli']); \n }\n ", "lang"=>"painless", "position"=>{"offset"=>86, "start"=>60, "end"=>104}, "caused_by"=>{"type"=>"date_time_parse_exception", "reason"=>"Text '' could not be parsed at index 0
here is the output section
output {
if "mm" in [service_name]
{
elasticsearch {Preformatted text
ssl => true
ssl_certificate_verification => true
ilm_rollover_alias => "provisioning_service"
ilm_pattern => "{now/d}-000001"
ilm_policy => "rollover-size-wise"
pipeline => "transfer-pipeline"
}
}
I still get the same error
["index", {:_id=>nil, :_index=>"provisioning_service", :routing=>nil, :_type=>"_doc", :pipeline=>"transfer-pipeline"}, #LogStash::Event:0x4a13394], :response=>{"index"=>{"_index"=>"provisioning_service", "_type"=>"_doc", "_id"=>nil, "status"=>400, "error"=>{"type"=>"illegal_argument_exception", "reason"=>"unable to parse date ", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"cannot parse empty date"}}}}}