# Logstash failed to execute action :exception=\>"Java::JavaLang::IllegalArgumentException", :message=\>"Illegal pattern component: O"

**URL:** <https://discuss.elastic.co/t/logstash-failed-to-execute-action-exception-java-illegalargumentexception-message-illegal-pattern-component-o/160616>\
**Category:** Logstash\
**Created:** [December 12, 2018, 8:13pm UTC](https://discuss.elastic.co/t/logstash-failed-to-execute-action-exception-java-illegalargumentexception-message-illegal-pattern-component-o/160616 "2018-12-12T20:13:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max\_Shen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/max_shen/32/38747_2.png) [@Max\_Shen](https://discuss.elastic.co/u/Max_Shen)\
**Post date:** [December 12, 2018, 8:13pm UTC](https://discuss.elastic.co/t/logstash-failed-to-execute-action-exception-java-illegalargumentexception-message-illegal-pattern-component-o/160616/1 "2018-12-12T20:13:45Z")

</div>

seems to be related to the date conversion, but couldn't figure out why it complains about token 0

> <https://github.com/JodaOrg/joda-time/blob/master/src/main/java/org/joda/time/format/DateTimeFormat.java#L406>

My Config

```
# Sample Logstash configuration for creating a simple
# Beats -> Logstash -> Elasticsearch pipeline.

input {
  file {
    path => "~/logstash-6.5.3/input/test.csv"
    start_position => "beginning"
    sincedb_path => "/dev/null"
  }
}

filter {
  csv {
    separator => ","
    columns => ["TRANSACTION_DATE", "CHECKOUT_DATE", "CHECKOUT_TIMESTAMP", "PAYMENT_TIMESTAMP", "PROGRAM_ID", "PROGRAM_NAME", "COMPANY NAME", "ID",
    "CAMPAIGN_NAME", "CAMPAIGN_ID", "TOOL_NAME", "LEAF_CATEGORY_ID", "VERTICAL_ID", "SITE_ID", "BUYER_ID",
    "BUYER_FREQUENCY", "SELLER_ID", "ITEM_ID", "PURCHASE_LATENCY_IN_MINUTES", "TRAFFIC_SOURCE", "QUANTITY", "GMB", "REVENUE", "PUBLISHER_EARNING", "BUYER_COUNTRY_ID","SELLER_COUNTRY_ID", "LEAF_CATEGORY_NAME", "VERTICAL_NAME","BUYER_COUNTRY","SELLER_COUNTRY"]
  }
  mutate {convert => ["QUANTITY", "integer"]}
  mutate {convert => ["PURCHASE_LATENCY_IN_MINUTES", "float"]}
  mutate {convert => ["EARNING", "float"]}
  mutate {convert => ["GMB", "float"]}

  date {
    match => ["TRANSACTION_DATE", "yyyy-MM-dd"]
    match => ["CHECKOUT_DATE", "yyyy-MM-dd"]
    match => ["CHECKOUT_TIMESTAMP", "yyyy-MM-dd HH:mm:ss"]
    match => ["PAYMENT_TIMESTAMP", "yyyy-MM-dd HH:mm:ss"]
    timezone => "MST"
    locale => "en"

  }
}

output {
  stdout {}
}

```

My input  
`2018-11-19,2018-11-19,2018-11-19 01:11:46,2018-11-19 01:11:46,1,US,MyPoints,123,sample+,444,sample,514,17,2,444,sample,444,111,31.222,desktop,1,3.80,0.78,0.123,1,2,"Jewellery & Watches:Vintage & Antique Jewellery:Costume:Victorian, Edwardian 1837-1910:Other Victorian Costume Jewels","Jewelry, Gems, Watches",Canada,United States`

my error

```
Date filter with format=yyyy-MM-dd, locale=en, timezone=MST built as org.logstash.filters.parser.JodaParser
[2018-12-12T12:03:19,897][ERROR][logstash.agent] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"Java::JavaLang::IllegalArgumentException", :message=>"Illegal pattern component: O", :backtrace=>["org.joda.time.format.DateTimeFormat.parsePatternTo(org/joda/time/format/DateTimeFormat.java:566)", "org.joda.time.format.DateTimeFormat.createFormatterForPattern(org/joda/time/format/DateTimeFormat.java:687)"
```

---

<div class="post-metadata">

**Author:** ![Max\_Shen](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/max_shen/32/38747_2.png) [@Max\_Shen](https://discuss.elastic.co/u/Max_Shen)\
**Post date:** [December 12, 2018, 9:46pm UTC](https://discuss.elastic.co/t/logstash-failed-to-execute-action-exception-java-illegalargumentexception-message-illegal-pattern-component-o/160616/2 "2018-12-12T21:46:34Z")

</div>

> [@Max\_Shen](#):
>
> Illegal pattern component: O

okay , this works

date {  
match =\> ["TRANSACTION\_DATE", "yyyy-MM-dd"]  
timezone =\> "MST"  
locale =\> "en"  
}  
date {  
match =\> ["CHECKOUT\_DATE", "yyyy-MM-dd"]  
timezone =\> "MST"  
locale =\> "en"  
}  
date {  
match =\> ["CHECKOUT\_TIMESTAMP", "yyyy-MM-dd HH:mm:ss.S"]  
timezone =\> "MST"  
locale =\> "en"  
}  
date {  
match =\> ["PAYMENT\_TIMESTAMP", "yyyy-MM-dd HH:mm:ss.S"]  
timezone =\> "MST"  
locale =\> "en"  
}

---

<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:** [January 9, 2019, 9:46pm UTC](https://discuss.elastic.co/t/logstash-failed-to-execute-action-exception-java-illegalargumentexception-message-illegal-pattern-component-o/160616/3 "2019-01-09T21:46:38Z")

</div>

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