-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] Refactor Timeline Events to use Search Strategy (#…
…77205) (#77657) Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
7edf54f
commit 2b4eeee
Showing
144 changed files
with
3,081 additions
and
1,985 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export interface AgentEcs { | ||
type?: string[]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
x-pack/plugins/security_solution/common/search_strategy/timeline/events/all/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common'; | ||
import { Ecs } from '../../../../ecs'; | ||
import { CursorType, Inspect, Maybe } from '../../../common'; | ||
import { TimelineRequestOptionsPaginated } from '../..'; | ||
|
||
export interface TimelineEdges { | ||
node: TimelineItem; | ||
cursor: CursorType; | ||
} | ||
|
||
export interface TimelineItem { | ||
_id: string; | ||
_index?: Maybe<string>; | ||
data: TimelineNonEcsData[]; | ||
ecs: Ecs; | ||
} | ||
|
||
export interface TimelineNonEcsData { | ||
field: string; | ||
value?: Maybe<string[]>; | ||
} | ||
|
||
export interface TimelineEventsAllStrategyResponse extends IEsSearchResponse { | ||
edges: TimelineEdges[]; | ||
totalCount: number; | ||
pageInfo: { | ||
activePage: number; | ||
totalPages: number; | ||
}; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface TimelineEventsAllRequestOptions extends TimelineRequestOptionsPaginated { | ||
fields: string[]; | ||
fieldRequested: string[]; | ||
} |
25 changes: 25 additions & 0 deletions
25
x-pack/plugins/security_solution/common/search_strategy/timeline/events/common/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { Ecs } from '../../../../ecs'; | ||
import { CursorType, Maybe } from '../../../common'; | ||
|
||
export interface TimelineEdges { | ||
node: TimelineItem; | ||
cursor: CursorType; | ||
} | ||
|
||
export interface TimelineItem { | ||
_id: string; | ||
_index?: Maybe<string>; | ||
data: TimelineNonEcsData[]; | ||
ecs: Ecs; | ||
} | ||
|
||
export interface TimelineNonEcsData { | ||
field: string; | ||
value?: Maybe<string[] | string>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
x-pack/plugins/security_solution/common/search_strategy/timeline/events/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export * from './all'; | ||
export * from './details'; | ||
export * from './last_event_time'; | ||
|
||
export enum TimelineEventsQueries { | ||
all = 'eventsAll', | ||
details = 'eventsDetails', | ||
lastEventTime = 'eventsLastEventTime', | ||
} |
32 changes: 32 additions & 0 deletions
32
...plugins/security_solution/common/search_strategy/timeline/events/last_event_time/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { IEsSearchResponse } from '../../../../../../../../src/plugins/data/common'; | ||
import { Inspect, Maybe } from '../../../common'; | ||
import { TimelineRequestBasicOptions } from '../..'; | ||
|
||
export enum LastEventIndexKey { | ||
hostDetails = 'hostDetails', | ||
hosts = 'hosts', | ||
ipDetails = 'ipDetails', | ||
network = 'network', | ||
} | ||
|
||
export interface LastTimeDetails { | ||
hostName?: Maybe<string>; | ||
ip?: Maybe<string>; | ||
} | ||
|
||
export interface TimelineEventsLastEventTimeStrategyResponse extends IEsSearchResponse { | ||
lastSeen: Maybe<string>; | ||
inspect?: Maybe<Inspect>; | ||
} | ||
|
||
export interface TimelineEventsLastEventTimeRequestOptions | ||
extends Omit<TimelineRequestBasicOptions, 'filterQuery' | 'timerange'> { | ||
indexKey: LastEventIndexKey; | ||
details: LastTimeDetails; | ||
} |
Oops, something went wrong.