kibana/x-pack/test/fleet_api_integration/config.event_ingested.ts
Julia Bardi f1f6117f04
[Fleet] added eventIngestedEnabled flag (#199733)
## Summary

Closes https://github.com/elastic/integrations/issues/11491

Added a separate flag `xpack.fleet.eventIngestedEnabled` (false by
default) to keep the `event.ingested` mapping even when
`agentIdVerificationEnabled` is disabled (in serverless oblt projects)

Created a new pipeline `.fleet_event_ingested_pipeline-1` to use when
only `eventIngestedEnabled` is enabled, to skip the step of calculating
`agent_id_status`.
I couldn't change `.fleet_final_pipeline-1` because the pipeline steps
have to be different based on the flags.

## To verify:
Note: After changing the flags, the packages have to be reinstalled to
see the changes in the index templates, tested with `elastic_agent`
package.
Also, the data streams should be rolled over to see the changes in the
ingested data.
```
POST logs-elastic_agent-default/_rollover
POST logs-elastic_agent.metricbeat-default/_rollover
```

### Default behaviour unchanged (Agent id verification enabled,
event.ingested flag disabled)
- by default: no change in behaviour, both `event.ingested` and
`event.agent_id_status` should be mapped

<img width="1381" alt="image"
src="https://github.com/user-attachments/assets/33c6fafc-1365-4e6a-b8fe-45f58a6c479e">
<img width="856" alt="image"
src="https://github.com/user-attachments/assets/54fefa62-bbb5-4ce5-a3dd-f56123e5e042">

### Agent id verification disabled, event.ingested enabled
- set in `kibana.yml`
```
xpack.fleet.agentIdVerificationEnabled: false
xpack.fleet.eventIngestedEnabled: true
```
- verify that `event.ingested` is mapped, `event.agent_id_status` is not

<img width="923" alt="image"
src="https://github.com/user-attachments/assets/0c18b3f2-6071-4f5a-a377-abeb4b4890ef">
<img width="1425" alt="image"
src="https://github.com/user-attachments/assets/2c93feca-a719-4cdb-983f-8f1269c22c88">
<img width="531" alt="image"
src="https://github.com/user-attachments/assets/b214143a-04a9-42d0-8ccc-07059d836039">
<img width="2342" alt="image"
src="https://github.com/user-attachments/assets/9247b6eb-e426-4eed-8d7c-3cb89be9dbdd">
<img width="2545" alt="image"
src="https://github.com/user-attachments/assets/d1b209cf-503d-47a0-ac06-1fd75395bab2">

### Agent id verification disabled, event.ingested disabled
- set in `kibana.yml`
```
xpack.fleet.agentIdVerificationEnabled: false
xpack.fleet.eventIngestedEnabled: false # default
```
- verify that neither `event.ingested` and `event.agent_id_status` is
mapped

<img width="522" alt="image"
src="https://github.com/user-attachments/assets/2434e4df-5b5e-45a5-a438-7b305834db63">

### Agent id verification enabled, event.ingested enabled
- set in `kibana.yml`
```
xpack.fleet.agentIdVerificationEnabled: true # default
xpack.fleet.eventIngestedEnabled: true
```
- both `event.ingested` and `event.agent_id_status` should be mapped

<img width="1284" alt="image"
src="https://github.com/user-attachments/assets/226838fe-8a2a-455f-812d-049d31fe4600">
<img width="858" alt="image"
src="https://github.com/user-attachments/assets/4fd99149-47f3-462c-b1ec-a2d45684560f">


### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
2024-11-13 12:41:40 +01:00

30 lines
1 KiB
TypeScript

/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { FtrConfigProviderContext } from '@kbn/test';
export default async function ({ readConfigFile }: FtrConfigProviderContext) {
const baseFleetApiConfig = await readConfigFile(require.resolve('./config.base.ts'));
const serverArgs: string[] = [
...baseFleetApiConfig.get('kbnTestServer.serverArgs'),
// serverless oblt needs only event.ingested, without agent id verification
`--xpack.fleet.agentIdVerificationEnabled=false`,
`--xpack.fleet.eventIngestedEnabled=true`,
];
return {
...baseFleetApiConfig.getAll(),
kbnTestServer: {
...baseFleetApiConfig.get('kbnTestServer'),
serverArgs,
},
testFiles: [require.resolve('./apis/event_ingested')],
junit: {
reportName: 'X-Pack Event Ingested API Integration Tests',
},
};
}