The green lines make for a good regular expression, once special characters are escaped and wildcards applied. \<ORDER CANCEL="." ORDER_NAME="[^"]+" TYPE="[12]">|Creating order cancellation transaction for order [^,]+,|JSON received for product import: {"records":\[{"lgnum":"407","entitled":"[^"]+","owner":"[^"]+","product":"[^"]+" There are two ways to filter events. The first uses a transform to find events that match a regex and send them either to an index or to nullQueue (equivalent to /dev/null). Add the following stanzas to transforms.conf: [setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue
[setparsing]
REGEX = \<ORDER CANCEL="." ORDER_NAME="[^"]+" TYPE="[12]">|Creating order cancellation transaction for order [^,]+,|JSON received for product import: {"records":\[{"lgnum":"407","entitled":"[^"]+","owner":"[^"]+","product":"[^"]+"
DEST_KEY = queue
FORMAT = indexQueue Then reference them in props.conf: [mysourcetype]
TRANSFORMS-set= setnull,setparsing See https://docs.splunk.com/Documentation/Splunk/9.1.0/Forwarding/Routeandfilterdatad#Keep_specific_events_and_discard_the_rest for the docs. The other method uses the newer INGEST_EVAL feature, also in transforms.conf. INGEST_EVAL = queue=if(match(_raw, "\<ORDER CANCEL=\".\" ORDER_NAME=\"[^\"]+\" TYPE=\"[12]\">|Creating order cancellation transaction for order [^,]+,|JSON received for product import: {\"records\":\[{\"lgnum\":\"407\",\"entitled\":\"[^\"]+\",\"owner\":\"[^\"]+\",\"product\":\"[^\"]+\""), "nullQueue", "indexQueue") See https://docs.splunk.com/Documentation/ITSI/4.17.0/Configure/transforms.conf for more.
... View more