Skip to content
This repository has been archived by the owner. It is now read-only.

grok_test doesn't handle | (pipe) symbols in message #1195

Closed
dkerwin opened this issue Apr 1, 2015 · 3 comments
Closed

grok_test doesn't handle | (pipe) symbols in message #1195

dkerwin opened this issue Apr 1, 2015 · 3 comments

Comments

@dkerwin
Copy link

@dkerwin dkerwin commented Apr 1, 2015

Scenario: Test grok pattern with a message containing one or more pipe symbols (|)
Expected result: Grok pattern should be applied
Actual result: Exception because the pipe symbol is not handled well by grok_test. Replacing | with %7C in a curl statement leads to the expected results.

Exception raised:

[error] play - Cannot invoke the action, eventually got an error: javax.ws.rs.core.UriBuilderException: java.net.URISyntaxException: Illegal character in query at index 370: http://459c1723-bfac-4427-9c90-c47c9b235ddb:session@127.0.0.1:12900/tools/grok_tester?pattern=%25%7BHAPROXYHTTPLOG%7D&string=%3C134%3E1+2015-03-31T15:05:00.857831%2B00:00+mt02+haproxy%5B4006%5D:+-+haproxy:++185.22.222.155:62219+%5B31/Mar/2015:15:05:00.116%5D+fe-api.gini.net~+api/10.1.8.3:49188_mt03.prod.gini.net+43/0/0/698/741+201+503+-+-+----+0/0/0/0/0+0/0+%7B3309481|Zend_Http_Client%7D+%22POST+/documents?filename%3D1508477_print+HTTP/1.1%22
[error] application -

! @6lk0dkce9 - Internal server error, for (GET) [/a/tools/grok_test?string=%3C134%3E1+2015-03-31T15%3A05%3A00.857831%2B00%3A00+mt02+haproxy%5B4006%5D%3A+-+haproxy%3A++185.22.222.155%3A62219+%5B31%2FMar%2F2015%3A15%3A05%3A00.116%5D+fe-api.gini.net~+api%2F10.1.8.3%3A49188_mt03.prod.gini.net+43%2F0%2F0%2F698%2F741+201+503+-+-+----+0%2F0%2F0%2F0%2F0+0%2F0+%7B3309481%7CZend_Http_Client%7D+%22POST+%2Fdocuments%3Ffilename%3D1508477_print+HTTP%2F1.1%22&pattern=%25%7BHAPROXYHTTPLOG%7D] ->

play.api.Application$$anon$1: Execution exception[[UriBuilderException: java.net.URISyntaxException: Illegal character in query at index 370: http://459c1723-bfac-4427-9c90-c47c9b235ddb:session@127.0.0.1:12900/tools/grok_tester?pattern=%25%7BHAPROXYHTTPLOG%7D&string=%3C134%3E1+2015-03-31T15:05:00.857831%2B00:00+mt02+haproxy%5B4006%5D:+-+haproxy:++185.22.222.155:62219+%5B31/Mar/2015:15:05:00.116%5D+fe-api.gini.net~+api/10.1.8.3:49188_mt03.prod.gini.net+43/0/0/698/741+201+503+-+-+----+0/0/0/0/0+0/0+%7B3309481|Zend_Http_Client%7D+%22POST+/documents?filename%3D1508477_print+HTTP/1.1%22]]
    at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.10-2.3.6.jar:2.3.6]
    at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.10-2.3.6.jar:2.3.6]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.6.jar:2.3.6]
    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.6.jar:2.3.6]
    at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.4.jar:na]
Caused by: javax.ws.rs.core.UriBuilderException: java.net.URISyntaxException: Illegal character in query at index 370: http://459c1723-bfac-4427-9c90-c47c9b235ddb:session@127.0.0.1:12900/tools/grok_tester?pattern=%25%7BHAPROXYHTTPLOG%7D&string=%3C134%3E1+2015-03-31T15:05:00.857831%2B00:00+mt02+haproxy%5B4006%5D:+-+haproxy:++185.22.222.155:62219+%5B31/Mar/2015:15:05:00.116%5D+fe-api.gini.net~+api/10.1.8.3:49188_mt03.prod.gini.net+43/0/0/698/741+201+503+-+-+----+0/0/0/0/0+0/0+%7B3309481|Zend_Http_Client%7D+%22POST+/documents?filename%3D1508477_print+HTTP/1.1%22
    at com.sun.jersey.api.uri.UriBuilderImpl.createURI(UriBuilderImpl.java:723) ~[com.sun.jersey.jersey-bundle-1.18.1.jar:1.18.1]
    at com.sun.jersey.api.uri.UriBuilderImpl._build(UriBuilderImpl.java:651) ~[com.sun.jersey.jersey-bundle-1.18.1.jar:1.18.1]
    at com.sun.jersey.api.uri.UriBuilderImpl.build(UriBuilderImpl.java:641) ~[com.sun.jersey.jersey-bundle-1.18.1.jar:1.18.1]
    at org.graylog2.restclient.lib.ApiClientImpl$ApiRequestBuilder.prepareUrl(ApiClientImpl.java:670) ~[org.graylog2.graylog2-rest-client-1.0.1.jar:na]
    at org.graylog2.restclient.lib.ApiClientImpl$ApiRequestBuilder.execute(ApiClientImpl.java:417) ~[org.graylog2.graylog2-rest-client-1.0.1.jar:na]
Caused by: java.net.URISyntaxException: Illegal character in query at index 370: http://459c1723-bfac-4427-9c90-c47c9b235ddb:session@127.0.0.1:12900/tools/grok_tester?pattern=%25%7BHAPROXYHTTPLOG%7D&string=%3C134%3E1+2015-03-31T15:05:00.857831%2B00:00+mt02+haproxy%5B4006%5D:+-+haproxy:++185.22.222.155:62219+%5B31/Mar/2015:15:05:00.116%5D+fe-api.gini.net~+api/10.1.8.3:49188_mt03.prod.gini.net+43/0/0/698/741+201+503+-+-+----+0/0/0/0/0+0/0+%7B3309481|Zend_Http_Client%7D+%22POST+/documents?filename%3D1508477_print+HTTP/1.1%22
    at java.net.URI$Parser.fail(URI.java:2829) ~[na:1.7.0_72]
    at java.net.URI$Parser.checkChars(URI.java:3002) ~[na:1.7.0_72]
    at java.net.URI$Parser.parseHierarchical(URI.java:3092) ~[na:1.7.0_72]
    at java.net.URI$Parser.parse(URI.java:3034) ~[na:1.7.0_72]
    at java.net.URI.<init>(URI.java:595) ~[na:1.7.0_72]
@joschi
Copy link
Contributor

@joschi joschi commented Apr 1, 2015

Fixing this might be related to #1190.

@joschi
Copy link
Contributor

@joschi joschi commented Apr 2, 2015

Fixed (for 1.0.x) by merging #1190.

@joschi joschi closed this Apr 2, 2015
@dkerwin
Copy link
Author

@dkerwin dkerwin commented Apr 7, 2015

Awesome 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants