|
After upgrading to 4.3 I noticed one of my timecharts was not working correctly:
UPDATE CLARIFICATION: The above worked fine on 4.0, 4.1 AND 4.2 without any changes to configuration being required. My question is about new behaviour as shown by 4.3 I eventually figured out that this was because of the In both the advanced charting & standard search views, the above term is removing far, far, far more events than just those where the field Any suggestions about why this is the case? Here is an example: Searching for
Searching for EDIT: So as suggested in the first answer, 'port!=16' seems to work fine. Why doesn't 'NOT'? Its still in the documentation? Is there anywhere I can file a bug? |
|
hexx was on the right track - the problem is that you are extracting the port from the source file path. By default, Splunk will look for the value of the extracted field in the event's text. In cases where it is not in the event text, you need to use fields.conf:
This tells Splunk that the value of port is not in the indexed data. Once you do this, you still might need to change the field name wherein the port is extracted from the event itself - perhaps call it port_number. Then your search could be:
So why doesn't this still work properly with the data where port was extracted from the event itself? Why does
(13 Jan '12, 01:08)
vaijpc
2
You have the right to your own opinion, but your comment above doesn't make much sense. fields.conf has been required for fields extracted from non-indexed data for several versions of Splunk.
(13 Jan '12, 09:09)
araitz ♦
So why does
(13 Jan '12, 09:22)
vaijpc
Also, I'm not sure you should accept your own answer on my question. I've undone your acceptance until we can get the details worked out.
(13 Jan '12, 09:23)
vaijpc
2
The reason it behaves differently, as I previously stated, is because you have some values of the port field extracted from the source, which is not an indexed value, and some extracted from indexed values. This is the way Splunk is expected to work. I was just able to confirm this on 4.3 - if I have fields extracted from either indexed values (exclusively) or non-indexed values (exclusively), both NOT and != function as expected. If I have a field that is a mishmash of indexed and non-indexed values, it does not work, as expected. If this worked before 4.3, I don't think it should have.
(13 Jan '12, 10:18)
araitz ♦
Aha right, thanks for the explanation. So I guess there's a good possibility that I will lose out in the future with more complex searches involving
(13 Jan '12, 13:50)
vaijpc
3
Put another way: By default, Splunk is looking for the term "16" in the index, then looks for the field "port" with value "16". This is why fields.conf is required - to tell Splunk "don't bother looking for the term 16 in the index". The search "port!=16" tells Splunk just to look for events with the field "port" with values not equal to "16", in effect achieving the same effect as fields.conf. I also considered that bloom filters (new in 4.3) might be the cause, but running './splunk cmd searchtest "search NOT port=15"' did not indicate that the filters were excluding any buckets.
(13 Jan '12, 14:04)
araitz ♦
1
You could also use "
(15 Jan '12, 13:12)
milestulett
showing 5 of 9
show 4 more comments ▼
|
|
Perhaps try ie: This seems to work... I might accept it later but for now I'm a little miffed that 'NOT' doesn't work despite it being in the documentation. Is this in the documentation? Can I rely on it?
(12 Jan '12, 01:16)
vaijpc
It might be that one is interpretive, while the other one is blind? Maybe I'm making things up, but that's the only explanation I can come up with at the moment..?
(12 Jan '12, 19:43)
milestulett
|
Oh and I also tried wrapping 16 in "s but that didn't help..
Could you give us an example of an event excluded by the "NOT port=16" term which shouldn't be?
@hexx here's 7! :)
Thank you. So, how is the "port" field extracted, and what is its value for that field in the events you've provided as samples?
@hexx "port" is an inline field extraction. For one sourcetype its extracted from the source file path. For another sourcetype its extracted from the log file line.