If you're using a grok filter you can list two expressions and it'll match either one, but you can use a conditional too, e.g. something similar to this (which matches the first kind of message):
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.