# java.lang.IllegalArgumentException: Illegal pattern component: t

**URL:** <https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348>\
**Category:** Logstash\
**Created:** [January 15, 2019, 5:03pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348 "2019-01-15T17:03:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marcos\_OS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcos_os/32/39699_2.png) [@Marcos\_OS](https://discuss.elastic.co/u/Marcos_OS)\
**Post date:** [January 15, 2019, 5:03pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348/1 "2019-01-15T17:03:32Z")

</div>

EN: I have a problem with Logstash and would like help in trying to resolve.  
PT: Eu tenho um problema com Logstash e gostaria de ajuda para tentar resolver.

EN: I'm trying to extract data from a relational database and send it to the elasticsearch.  
PT: Estou tentando extrair dados de um baco de dados relacional e enviar para o elasticsearch.

EN: My Settings:  
PT: Minhas configurações:

/etc/logstash/conf.d/01-main.conf  
input {  
tcp {  
port =\> 5000  
type =\> "logstash-tcp"  
}  
http {  
port =\> 5043  
type =\> "logstash-http"  
response\_headers =\> {  
"Access-Control-Allow-Origin" =\> "_"  
"Content-Type" =\> "text/plain"  
"Access-Control-Allow-Headers" =\> "Origin, X-Requested-With, Content-Type, Accept"  
}  
}  
beats {  
port =\> 5044  
type =\> "logstash-beats"  
}  
gelf {  
port =\> 12201  
type =\> "logstash-gelf"  
}  
file {  
path =\> "/var/log/elk"  
type =\> "logstash-file"  
start\_position =\> "beginning"  
}  
jdbc {  
jdbc\_driver\_library =\> "/etc/logstash/jdbc/ojdbc7.jar"  
jdbc\_driver\_class =\> "Java::oracle.jdbc.driver.OracleDriver"  
jdbc\_connection\_string =\> "jdbc:oracle:thin:@IP:PORTA/SID"  
jdbc\_user =\> "username"  
jdbc\_password =\> "password"  
jdbc\_validate\_connection =\> true  
jdbc\_fetch\_size =\> 50000  
schedule =\> "_ \* \* \* \* America/Sao\_Paulo"  
sql\_log\_level =\> "debug"  
statement =\> "SELECT \* FROM TTR"  
type =\> "logstash-jdbc"  
}  
}

output {  
# elasticsearch {  
# hosts =\> ["[http://elasticsearch:9200](http://elasticsearch:9200)" ]  
# user =\> elastic  
# password =\> "${elastic\_password}"  
# index =\> "logstash-6.5.4-%{+type}-%{+YYYY.MM.dd}"  
# document\_id =\> "%{id}"  
# codec =\> json  
# }  
stdout {  
codec =\> rubydebug  
}  
}

EN: Output to the above configuration:  
PT: Saída para a configuração acima:

logstash[14695]: {  
logstash[14695]: "ttrclsautvo" =\> "ABC",  
logstash[14695]: "ttrcod" =\> 123,  
logstash[14695]: "ttridcisncpmf" =\> 0,  
logstash[14695]: "ttrclsprc" =\> "ABC",  
logstash[14695]: "ttrdes" =\> "ABC",  
logstash[14695]: "ttrclslog" =\> "ABC",  
logstash[14695]: "ttridchab" =\> 1,  
logstash[14695]: "ttrclsstyaut" =\> nil,  
logstash[14695]: "ttrcodest" =\> 0,  
logstash[14695]: "@version" =\> "1",  
logstash[14695]: "@timestamp" =\> 2019-01-15T16:55:11.709Z,  
logstash[14695]: "type" =\> "logstash-jdbc",  
logstash[14695]: "ttrdathorcrg" =\> 2006-02-10T03:00:00.000Z,  
logstash[14695]: "ttrdesres" =\> "ABC",  
logstash[14695]: "ttrclsaut" =\> "ABC",  
logstash[14695]: "ttrclstot" =\> "ABC",  
logstash[14695]: "ttrtip" =\> 0,  
logstash[14695]: "ttrclsttr" =\> "ABC",  
logstash[14695]: "ttrclssty" =\> "ABC",  
logstash[14695]: "ttrclsprcagd" =\> "ABC"  
logstash[14695]: }

EN: When I send the output to elasticsearch, the following error occurs:  
PT: Quando envio a saída para o elasticsearch, ocorre o seguinte erro:

logstash[14157]: Exception in thread "Ruby-0-Thread-10: :1" Exception in thread "Ruby-0-Thread-7: :1" java.lang.IllegalArgumentException: Illegal pattern component: t  
logstash[14157]: at org.joda.time.format.DateTimeFormat.parsePatternTo(DateTimeFormat.java:566)  
logstash[14157]: at org.joda.time.format.DateTimeFormat.createFormatterForPattern(DateTimeFormat.java:687)  
logstash[14157]: at org.joda.time.format.DateTimeFormat.forPattern(DateTimeFormat.java:177)  
logstash[14157]: at org.logstash.StringInterpolation.evaluate(StringInterpolation.java:48)  
logstash[14157]: at org.logstash.Event.sprintf(Event.java:262)  
logstash[14157]: at org.logstash.ext.JrubyEventExtLibrary$RubyEvent.ruby\_sprintf(JrubyEventExtLibrary.java:175)  
logstash[14157]: at usr.share.logstash.vendor.bundle.jruby.$2\_dot\_3\_dot\_0.gems.logstash\_minus\_output\_minus\_elasticsearch\_minus\_9\_dot\_2\_dot\_4\_minus\_java.lib.logstash.outputs.elasticsearch.common.RUBY$method$event\_action\_tuple$0(/usr/share/logstash/vendor/bundle/jruby/2.3.0/gems/logstash-output-elasticsearch-9.2.4-java/lib/logstash/outputs/elasticsearch/common.rb:68)

EN: Structure of the table in the relational database:  
PT: Estrutura da tabela no banco de dados relacional:

```
Nome Nulo Tipo          
------------- -------- ------------- 
TTRCOD NOT NULL NUMBER(8)     
TTRDES NOT NULL VARCHAR2(40)  
TTRDESRES NOT NULL VARCHAR2(15)  
TTRTIP NOT NULL NUMBER(1)     
TTRCODEST NUMBER(8)     
TTRIDCISNCPMF NOT NULL NUMBER(1)     
TTRCLSTTR VARCHAR2(120) 
TTRCLSLOG VARCHAR2(120) 
TTRCLSAUT VARCHAR2(120) 
TTRCLSPRC VARCHAR2(120) 
TTRCLSTOT VARCHAR2(120) 
TTRCLSSTY VARCHAR2(120) 
TTRCLSSTYAUT VARCHAR2(120) 
TTRDATHORCRG DATE          
TTRCLSPRCAGD VARCHAR2(120) 
TTRCLSAUTVO VARCHAR2(120) 
TTRIDCHAB NOT NULL NUMBER(1)   

```

EN: I tried to configure with some answers that I found in the forum, but without success.  
PT: Tentei configurar com algumas respostas que encontrei no fórun, porém sem sucesso.

---

<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:** [January 15, 2019, 5:18pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348/2 "2019-01-15T17:18:27Z")

</div>

> [@Marcos\_OS](#):
>
> index =\> "logstash-6.5.4-%{+type}-%{+YYYY.MM.dd}"

I think it is trying to interpret %{+type} as a time format. Does it work if you change it to

```
index => "logstash-6.5.4-%{type}-%{+YYYY.MM.dd}"

```

---

<div class="post-metadata">

**Author:** ![Marcos\_OS](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marcos_os/32/39699_2.png) [@Marcos\_OS](https://discuss.elastic.co/u/Marcos_OS)\
**Post date:** [January 15, 2019, 6:06pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348/3 "2019-01-15T18:06:05Z")

</div>

EN: Thank you very much @Badger  
EN: My whole focus was on the jdbc input and filter.

PT: Muito obrigado @Badger  
PT: Todo o meu foco estava na entrada jdbc e filtro

---

<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:** [February 12, 2019, 6:06pm UTC](https://discuss.elastic.co/t/java-lang-illegalargumentexception-illegal-pattern-component-t/164348/4 "2019-02-12T18:06:13Z")

</div>

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