From 37941fe9d04cb2b16c2ac03abac14c53ebd9146a Mon Sep 17 00:00:00 2001 From: Steph Milovic Date: Wed, 2 Oct 2019 15:34:38 -0600 Subject: [PATCH] hide siem data on empty string or _all --- .../siem/server/graphql/source_status/resolvers.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts b/x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts index e0597d19a59da..24589822f0250 100644 --- a/x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts +++ b/x-pack/legacy/plugins/siem/server/graphql/source_status/resolvers.ts @@ -31,9 +31,21 @@ export const createSourceStatusResolvers = (libs: { } => ({ SourceStatus: { async indicesExist(source, args, { req }) { + if ( + args.defaultIndex.length === 1 && + (args.defaultIndex[0] === '' || args.defaultIndex[0] === '_all') + ) { + return false; + } return libs.sourceStatus.hasIndices(req, args.defaultIndex); }, async indexFields(source, args, { req }) { + if ( + args.defaultIndex.length === 1 && + (args.defaultIndex[0] === '' || args.defaultIndex[0] === '_all') + ) { + return []; + } return libs.fields.getFields(req, args.defaultIndex); }, },