[ 
https://issues.apache.org/jira/browse/SOLR-14699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17542679#comment-17542679
 ] 

Gus Heck commented on SOLR-14699:
---------------------------------

The routines I've written typically extract the region between the first curly 
brace and the last curly brace in the log line (inclusive), Quote everything 
either side of the equals/ampersands, convert '=' to ':' and '&' to ','... then 
handle some other details with escaping and parse the result with a Json parser 
to get a java map... The key thing is to provide an easy way to isolate the 
parameters from the rest of the log line *programmatically*. I don't feel like 
a space is likely to make this easy as there can be any number of spaces before 
or after the parameters... and if one has to count spaces that's pretty brittle 
vs small changes in how things are logged. Honestly, if we are going to change 
anything, I would keep the delimiters and make the contents of the delimiters 
parsable easily into a java map of type <String,List<String>>. Be that JSON or  
URL encoded parameters or whatever. A couple of delimiters are a cheap way to 
make parsing easy. Don't care if it's curlies, pipes or whatever. Just want 
something that's uncommon in the rest of the log line. 

> Solr request logs should escape names, values 
> (SolrQueryResponse.getToLogAsString)
> ----------------------------------------------------------------------------------
>
>                 Key: SOLR-14699
>                 URL: https://issues.apache.org/jira/browse/SOLR-14699
>             Project: Solr
>          Issue Type: Improvement
>          Components: logging
>            Reporter: David Smiley
>            Priority: Minor
>
> {{SolrQueryResponse.getToLogAsString}} encodes the NamedList into a String 
> with simple space-separated pairs with name=value.  However, it does no 
> escaping/encoding, and as-such a value might itself contain spaces and 
> equals.  This is a problem if these logs are being parsed, and we'd like to 
> ensure we do so correctly.  Note that SolrLogPostTool (aka "postlogs") parses 
> these logs.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org
For additional commands, e-mail: issues-h...@solr.apache.org

Reply via email to