I have a handful of different sourcetypes that all get written to log files in /var/log/app. I also have more than one index that the files can be sent to depending on their type. From my testing, and from what I can understand from the documentation I can't have multiple [monitor] stanzas with whitelist/blacklists for logs that live in the same directory. Therefore in order to assign sourcetype and index based on some filename regex it would seem my choices are limited to the following:
don't use wildcards or whitelist|blacklists in inputs.conf. Instead on the LWF inputs.conf create a monitor stanza for each possible logfile name and assign the sourcetype and index in the monitor stanza. This is highly undesirable for me because i have about 300-400 different log file names and it also means i have to update the list each time a new log name is created
in my LWF inputs.conf create a single monitor stanza that captures all the logs in the directory. On my indexers create a props.conf with multiple source statments, use the priority option to order similar wildcard source stanzas and also define a transform to assign the index. In this option I'm most concerned about the performance of assigning the index via a transform. Is this intensive?
an example of option 2 would be as follows:
example Log files:
coolservice.log (sourcetype: log4j, index:main)
coolservice-web.log (sourcetype:access_common, index:main)
coolservice-req.log (sourcetype:access_common, index:main)
coolservice-billing.log (sourcetype:custom-billing, index:billing)
radservice.log (sourcetype: log4j, index:main)
radservice-web.log (sourcetype:access_common, index:main)
radservice-req.log (sourcetype:access_common, index:main)
radservice-billing.log (sourcetype:custom-billing, index:billing)
... (with 50 different service names)
inputs.conf (on the LWF)
[monitor:///var/log/app/]
whitelist = \w+\.(?:\d{4}-\d{2}-\d{2}|log)$
# i want to ignore zipped files
blacklist = \.(gz|bz2|z|zip)$
**props.conf (on my indexers)**
# billing logs
# eg coolservice-billing.log or coolservice-billing.2011-03-03
# or coolservice-billing.2011-03-03.log
[source::\w+-billing\.(?:\d{4}-\d{2}-\d{2}|log)$
sourcetype = custom-billing
TRANSFORMS-index = billingindex
priority = 200
# web logs
[source::\w+-(?:web|req)\.(?:\d{4}-\d{2}-\d{2}|log)$
sourcetype = log4j
TRANSFORMS-index = mainindex
# log4j service logs
[source::\w+\.(?:\d{4}-\d{2}-\d{2}|log)$
sourcetype = log4j
TRANSFORMS-index = mainindex
transforms.conf (on my indexers)
[billingindex]
REGEX = .*
DEST_KEY = _MetaData:Index
FORMAT = billingindex
[mainindex]
REGEX = .*
DEST_KEY = _MetaData:Index
FORMAT = mainindex
so my questions are:
Is this the best/only way to do it?
Will I suffer any indexing perf problems doing it this way?
... View more