I set up an external field lookup and got it working properly. Today I tried add a second. So far, I can only get one to work at a time (the last one listed in the props.conf file). I've switched the order of the stanzas and found that they each work but not together. Is there something that must be done to make them work together?
EDIT Here are the stanzas, with my machine name excised.
[$MyMachineName$]
LOOKUP-table = logs_per_day host OUTPUTNEW average_logs AS logs_per_day
[sendmail]
LOOKUP-table = location host OUTPUTNEW building AS location
If, as pdevlin guesses, you have one lookup attached to the host, and one lookup attached to the sourcetype, then the intersection of these will only perform ONE of these two lookups.
That is:
This is by design. When you name your lookup "LOOKUP-table" you're essentially saying that this is the lookup which achieves some purpose or action described by "table". When you define it differently in different stanzas, this means that you wish the lookup to operate differently in different cases. Typically this is when you want the lookup to happen one way for most data (a default) but for some app, or some data source, etc you want to override how this is handled.
In your case, these lookups achieve different goals. One seems to be intended to determine something about logs per day, while the other seems to be something about location. You might want:
[host::machine_name]
LOOKUP-logsperday = logs_per_day host OUTPUTNEW average_logs AS logs_per_day
[sendmail]
LOOKUP-location = location host OUTPUTNEW building AS location
Now you have two different settings which are not intended to collide. You know more about what these lookups do, so you can probably give them more descriptive class names.
My guess is that you need to add the host:: prefix to your "$MyMachineName$" stanza. It's not entirely clear but looks as if any stanza defined without a prefix is assumed to be a sourcetype. See props.conf.spec for more information.
Example:
[host::$MyMachineName$]
LOOKUP-table = logs_per_day host ....
[sendmail]
LOOKUP-table = location host ....
Could you post the stanzas please?
Are you trying to add a second for the same spec stanza? If so, make sure the class name is different.
The class name is how one stanza overrides the other. It's important to make sure that each distinct lookup has its own class name.
class name shouldn't matter in two different stanzas, but I suspect if you make them different it will work fine. looks like a bug
There are two different stanzas though, so does the class name matter?