# Pipeline aborted due to error help me

**URL:** <https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838>\
**Category:** Logstash\
**Created:** [February 25, 2020, 11:31am UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838 "2020-02-25T11:31:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [February 25, 2020, 11:31am UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/1 "2020-02-25T11:31:42Z")

</div>

i'm working with logstash the current version 7.6  
i have 44 columns , 4 of them are date but contains nothing  
i declared them as a data it's not accepted  
i didn't dclare them still not accepted ( cuz i know that it's taken as a string default)  
so as a solution i'm trying to force them as a string  
i tried this code but an error is shwon help

input{  
file{  
path =\> "/home/user/data/test-536.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter{  
csv{  
separator =\> ","  
columns =\> ["Supervision Period Warning Played Flag",.......,"Community Id 3",]

```
	}
    mutate {
		convert => {
		"Supervision Period Warning Played Flag" => "integer"
	         .............
		"Community Id 3" => "integer"
		}
	}
	mutate {
            convert => { "Negative Balance Barring Start Date" => "string" }
            convert => { "Last Service Fee Deduction Date" => "string"}
	}
			
	mutate {
		add_field => {"D"=> ["2020-01-01"]}
	}
	
	date {	
		match => ["Supervision Period Expiry Date", "YYYY-MM-dd"]
		target => "Supervision Period Expiry Date"
	}

```

}  
output{  
elasticsearch{  
hosts =\> "localhost"  
index =\> "sub1"  
document\_type =\> "subscriber"  
}  
stdout{}  
}

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [February 25, 2020, 11:33am UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/2 "2020-02-25T11:33:05Z")

</div>

and my error is :  
[2020-02-25T11:55:29,007][INFO][logstash.outputs.elasticsearch][main] Using default mapping template  
[2020-02-25T11:55:29,092][ERROR][logstash.javapipeline][main] Pipeline aborted due to error {:pipeline\_id=\>"main", :exception=\>#\<LogStash::ConfigurationError: translation missing: en.logstash.agent.configuration.invalid\_plugin\_register\>, :backtrace=\>["/home/samar/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-mutate-3.5.0/lib/logstash/filters/mutate.rb:222:in `block in register'", "org/jruby/RubyHash.java:1428:in `each'", "/home/samar/logstash/vendor/bundle/jruby/2.5.0/gems/logstash-filter-mutate-3.5.0/lib/logstash/filters/mutate.rb:220:in `register'", "org/logstash/config/ir/compiler/AbstractFilterDelegatorExt.java:56:in `register'", "/home/samar/logstash/logstash-core/lib/logstash/java\_pipeline.rb:200:in `block in register_plugins'", "org/jruby/RubyArray.java:1814:in `each'", "/home/samar/logstash/logstash-core/lib/logstash/java\_pipeline.rb:199:in `register_plugins'", "/home/samar/logstash/logstash-core/lib/logstash/java_pipeline.rb:502:in `maybe\_setup\_out\_plugins'", "/home/samar/logstash/logstash-core/lib/logstash/java\_pipeline.rb:212:in `start_workers'", "/home/samar/logstash/logstash-core/lib/logstash/java_pipeline.rb:154:in `run'", "/home/samar/logstash/logstash-core/lib/logstash/java\_pipeline.rb:109:in `block in start'"], "pipeline.sources"=\>["/home/samar/logstash/config/test.config"], :thread=\>"#\<Thread:0x29692259 run\>"}  
[2020-02-25T11:55:29,149][ERROR][logstash.agent] Failed to execute action {:id=\>:main, :action\_type=\>LogStash::ConvergeResult::FailedAction, :message=\>"Could not execute action: PipelineAction::Create, action\_result: false", :backtrace=\>nil}  
[2020-02-25T11:55:29,217][INFO][logstash.outputs.elasticsearch][main] Attempting to install template {:manage\_template=\>{"index\_patterns"=\>"logstash-_", "version"=\>60001, "settings"=\>{"index.refresh\_interval"=\>"5s", "number\_of\_shards"=\>1}, "mappings"=\>{"dynamic\_templates"=\>[{"message\_field"=\>{"path\_match"=\>"message", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false}}}, {"string\_fields"=\>{"match"=\>"_", "match\_mapping\_type"=\>"string", "mapping"=\>{"type"=\>"text", "norms"=\>false, "fields"=\>{"keyword"=\>{"type"=\>"keyword", "ignore\_above"=\>256}}}}}], "properties"=\>{"@timestamp"=\>{"type"=\>"date"}, "@version"=\>{"type"=\>"keyword"}, "geoip"=\>{"dynamic"=\>true, "properties"=\>{"ip"=\>{"type"=\>"ip"}, "location"=\>{"type"=\>"geo\_point"}, "latitude"=\>{"type"=\>"half\_float"}, "longitude"=\>{"type"=\>"half\_float"}}}}}}}

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [February 25, 2020, 11:47am UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/3 "2020-02-25T11:47:39Z")

</div>

Hi

Try commenting out the second `mutate{}`, where you convert date fields to `string`, and all the `date{}` plugin instances, and see what you get from `stdoutput{}`.

You can also comment out your `elasticsearch{}` output for now (no need to send anything there until you get it right).

I'm thinking you won't need this instance of `mutate{}` because your data is already `string` out of the `csv{}` filter. Then you'll have to "protect" your `date{}` instances with `if` statements to check for empty fields. But I'd start, as I suggested above, by checking what you get without filtering the data.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [February 25, 2020, 12:39pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/4 "2020-02-25T12:39:20Z")

</div>

okay thank u  
but how can i deal with this emty fields that i have ?  
do i need to set a condition on it or what ?

---

<div class="post-metadata">

**Author:** ![ITIC](https://avatars.discourse-cdn.com/v4/letter/i/90ced4/32.png) [@ITIC](https://discuss.elastic.co/u/ITIC)\
**Post date:** [February 25, 2020, 1:00pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/5 "2020-02-25T13:00:15Z")

</div>

Hi

Exactly. The `date{}` plugin will "crash" if the field is empty, so you have to wrap it inside an `if` statement that will ensure `date{}` is called only iff the field is not empty.

You can read about conditionals here: [https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals](https://www.elastic.co/guide/en/logstash/current/event-dependent-configuration.html#conditionals), and see some examples here: [https://www.elastic.co/guide/en/logstash/current/config-examples.html#using-conditionals](https://www.elastic.co/guide/en/logstash/current/config-examples.html#using-conditionals)

Hope this helps.

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [February 25, 2020, 2:24pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/6 "2020-02-25T14:24:32Z")

</div>

well i'm trying to find a condition on empty fields but nothing is working  
i found  
csv {  
source =\> "message"  
}  
if ! [""] {  
mutate {  
update =\> { "" =\> " " }  
}  
}  
i tried it but it's not working

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [February 25, 2020, 3:47pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/7 "2020-02-25T15:47:32Z")

</div>

mutate does not support "long" as a type it can convert to.

---

<div class="post-metadata">

**Author:** ![samargh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/samargh/32/70171_2.png) [@samargh](https://discuss.elastic.co/u/samargh)\
**Post date:** [February 25, 2020, 4:43pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/9 "2020-02-25T16:43:16Z")

</div>

i found the solution ( add the ruby filter to see if it's empty field it will remove it else if it's full it will keep it )  
input{  
file{  
path =\> "/home/user/data/test-536-Copie.csv"  
start\_position =\> "beginning"  
sincedb\_path =\> "/dev/null"  
}  
}  
filter{  
csv{  
separator =\> ","  
columns =\> ["Service Fee Period Warning Played Flag",........,"Community Id 3"]

```
	}
	ruby {
            code => "
                    hash = event.to_hash
                    hash.each do |k,v|
                            if v == nil
                                    event.remove(k)
                            end
                    end
            "
    }
	mutate {
		convert => {
		"Supervision Period Warning Played Flag" => "integer"
                     ..........
		"Community Id 3" => "integer"
		}
	}
	mutate {
		add_field => {"D"=> ["2020-01-01"]}
	}
	date {	
		match => ["Supervision Period Expiry Date", "YYYY-MM-dd"]
		target => "Supervision Period Expiry Date"
	}
	
	
}

```

output{  
elasticsearch{  
hosts =\> "localhost"  
index =\> "sub122"  
document\_type =\> "subscriber"  
}  
stdout{codec =\> rubydebug }  
}

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 24, 2020, 4:43pm UTC](https://discuss.elastic.co/t/pipeline-aborted-due-to-error-help-me/220838/10 "2020-03-24T16:43:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
