I am using solr which has multiple collections in it. Solr dumps the log of all collections into a single file(solr.log) and I want the logs of one particular collection.
The key is to pick patterns that aren't too wide (i.e. could match too much) but still matches all the possible values. Let's look at some of the strings that you wanted to match with DATA:
org.apache.solr.core.SolrCore: Use %{JAVACLASS}.
example3_shard1_replica1: I don't know what this string means, but it's a reasonable assumption that it can't contain a closing square bracket so we can use that as a delimiter: (?<collection>[^\]]+).
/solr: It's probably safe to assume that there can't be any spaces here (and if there are spaces in the URL they're probably still encoded with %20 or +). So: %{NOTSPACE:webapp}
Actually, the latter part of the string contains a bunch of key=value pairs. Using the kv filter for parsing them should be convenient.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.