Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] AgentEvent change agent_id and remove data #57818

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion x-pack/plugins/ingest_manager/common/types/models/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const AgentEventBase = {
timestamp: schema.string(),
message: schema.string(),
payload: schema.maybe(schema.any()),
data: schema.maybe(schema.string()),
agent_id: schema.string(),
action_id: schema.maybe(schema.string()),
policy_id: schema.maybe(schema.string()),
stream_id: schema.maybe(schema.string()),
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ingest_manager/dev_docs/api/agents_checkin.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Report current state of a Fleet agent.

## Request body

- `events` (Required, array) An array of events with the properties `type`, `subtype`, `message`, `timestamp`, `payload`, and `data`.
- `events` (Required, array) An array of events with the properties `type`, `subtype`, `message`, `timestamp`, `payload`, and `agent_id`.

- `local_metadata` (Optional, object) An object that contains the local metadata for an agent. The metadata is a dictionary of strings (example: `{ "os": "macos" }`).

Expand All @@ -33,7 +33,7 @@ Authorization: ApiKey VALID_ACCESS_API_KEY
"message": "state changed from STOPPED to STARTING",
"timestamp": "2019-10-01T13:42:54.323Z",
"payload": {},
"data": "{}"
"agent_id": "a4937110-e53e-11e9-934f-47a8e38a522c"
}]
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ async function createEventsForAgent(
eventData => {
return {
attributes: {
agent_id: agentId,
...eventData,
payload: eventData.payload ? JSON.stringify(eventData.payload) : undefined,
},
Expand Down
1 change: 1 addition & 0 deletions x-pack/test/api_integration/apis/fleet/agents/checkin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export default function(providerContext: FtrProviderContext) {
timestamp: '2019-01-04T14:32:03.36764-05:00',
subtype: 'STARTING',
message: 'State change: STARTING',
agent_id: 'agent1',
},
],
local_metadata: {
Expand Down