# "Expected one of \[ \\\\t\\\\r\\\\n\], \\"#\\", \\"{\\", \\"}\\"

**URL:** <https://discuss.elastic.co/t/expected-one-of-t-r-n/269151>\
**Category:** Logstash\
**Tags:** docker\
**Created:** [April 3, 2021, 12:56pm UTC](https://discuss.elastic.co/t/expected-one-of-t-r-n/269151 "2021-04-03T12:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmrgbox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmrgbox/32/86529_2.png) [@tmrgbox](https://discuss.elastic.co/u/tmrgbox)\
**Post date:** [April 3, 2021, 12:56pm UTC](https://discuss.elastic.co/t/expected-one-of-t-r-n/269151/1 "2021-04-03T12:56:38Z")

</div>

Hi,  
I'm trying to parse a log using the following config:

> input {  
> udp {  
> port =\> 5555  
> type =\> "esetlog"  
> add\_field =\> {  
> "etl\_input\_port" =\> 5555  
> "etl\_input\_protocol" =\> "udp"  
> }
> 
> }  
> }
> 
> filter {  
> if [type] == "esetlog" {  
> grok {  
> match =\> {  
> "message" =\> "\<%{NONNEGINT:syslog\_pri}\>%{NONNEGINT:version} %{TIMESTAMP\_ISO8601:syslog\_timestamp} (?\<server\_name\>._){"event\_type":"%{WORD:event\_type}","ipv4":"%{IPV4:device\_ip}","hostname":"(?._)","source\_uuid":"%{UUID:uuid}","occured":"(?\<date\_of\_event\>%{MONTHDAY}[/-]%{MONTH}[/-]%{YEAR} %{TIME})","severity":"%{WORD:severity}","(event":"(?._)|threat\_type":"(?\<threat\_type\>._))","(source\_address":"%{IPV4:source\_address}|threat\_name":"(?\<threat\_name\>._))","(source\_address\_type":"%{WORD:source\_address\_type}|scanner\_id":"(?\<scanner\_id\>._))","(source\_port":%{NUMBER:source\_port}|scan\_id":"(?\<scan\_id\>._))(,"|",")(target\_address":"%{IPV4:target\_address}|engine\_version":"(?\<engine\_version\>._))","(object\_type":"%{WORD:object\_type}|target\_address\_type":"%{WORD:target\_address\_type})","(object\_uri":"(?._)|target\_port":%{NUMBER:target\_port})(,"|",")(action\_taken":"(?\<action\_taken\>._)|protocol":"%{WORD:protocol})","(threat\_handled":%{WORD:threat\_handled}|account":"(?._))(,"|",")(need\_restart":%{WORD:need\_restart}|process\_name":"(?\<process\_name\>._))(,"|",")(username":"(?._)|inbound":%{WORD:inbound})(,"|",")(processname":"%{WINPATH:processname}|threat\_name":"(?\<threat\_name\>._))","(circumstances":"(?._).","|aggregate\_count":%{NUMBER:aggregate\_count})(hash":"(?._)")?(})%{GREEDYDATA:error}"  
> }  
> }  
> }  
> }

This is the error is receive:

`[ERROR][logstash.agent] Failed to execute action {:id=>:main, :action_type=>LogStash::ConvergeResult::FailedAction, :message=>"Expected one of [\\t\\r\\n], \"#\", \"{\", \"}\" at line 19, column 147 (byte 469) after filter {\n if [type] == \"esetlog\" {\n grok {\n match => {\n \"message\" => \"<%{NONNEGINT:syslog_pri}>%{NONNEGINT:version} %{TIMESTAMP_ISO8601:syslog_timestamp} (?<server_name>.*){\\\"event_type\"", :backtrace=>["/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:41:in `compile\_imperative'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:49:in `compile_graph'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:11:in `block in compile\_sources'", "org/jruby/RubyArray.java:2580:in `map'", "/usr/share/logstash/logstash-core/lib/logstash/compiler.rb:10:in `compile\_sources'", "org/logstash/execution/AbstractPipelineExt.java:161:in `initialize'", "org/logstash/execution/JavaBasePipelineExt.java:47:in `initialize'", "/usr/share/logstash/logstash-core/lib/logstash/pipeline\_action/reload.rb:37:in `execute'", "/usr/share/logstash/logstash-core/lib/logstash/agent.rb:326:in `block in converge\_state'"]}`

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [April 3, 2021, 1:33pm UTC](https://discuss.elastic.co/t/expected-one-of-t-r-n/269151/2 "2021-04-03T13:33:14Z")

</div>

Your data in the message field has `"` in it and it thinks the string is ending and then goes wacko.

Try wrapping the data in a `'` instead.

```auto
"message" => 'data goes here and can gave a " in it'

```

If that doesn't work then you just need to escape all of them `/`.

---

<div class="post-metadata">

**Author:** ![tmrgbox](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmrgbox/32/86529_2.png) [@tmrgbox](https://discuss.elastic.co/u/tmrgbox)\
**Post date:** [April 4, 2021, 8:14am UTC](https://discuss.elastic.co/t/expected-one-of-t-r-n/269151/3 "2021-04-04T08:14:35Z")

</div>

Thanks for the help!

---

<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:** [May 2, 2021, 8:15am UTC](https://discuss.elastic.co/t/expected-one-of-t-r-n/269151/4 "2021-05-02T08:15:14Z")

</div>

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