mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[server/logging] only match tags that are in the right order
This commit is contained in:
parent
866abcc820
commit
1973ed8a91
2 changed files with 5 additions and 5 deletions
|
@ -31,11 +31,11 @@ describe('server logging LogInterceptor', () => {
|
|||
assertDowngraded(interceptor.downgradeIfEconnreset(event));
|
||||
});
|
||||
|
||||
it('matches even when the tags are out of order', () => {
|
||||
it('does not match if the tags are not in order', () => {
|
||||
const interceptor = new LogInterceptor();
|
||||
const event = stubEconnresetEvent();
|
||||
event.tags = shuffle(event.tags.slice(0));
|
||||
assertDowngraded(interceptor.downgradeIfEconnreset(event));
|
||||
event.tags = [...event.tags.slice(1), event.tags[0]];
|
||||
expect(interceptor.downgradeIfEconnreset(event)).to.be(null);
|
||||
});
|
||||
|
||||
it('ignores non ECONNRESET events', () => {
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import Stream from 'stream';
|
||||
import { get, isEqual, sortBy } from 'lodash';
|
||||
import { get, isEqual } from 'lodash';
|
||||
|
||||
function doTagsMatch(event, tags) {
|
||||
return isEqual(sortBy(get(event, 'tags')), sortBy(tags));
|
||||
return isEqual(get(event, 'tags'), tags);
|
||||
}
|
||||
|
||||
export class LogInterceptor extends Stream.Transform {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue