Skip to content

Commit

Permalink
Add ignore and restrict fields (#5203)
Browse files Browse the repository at this point in the history
* Add ignore and restrict fields

* change labels

* add changelog

* Remove the last dot

(cherry picked from commit 326b874)
  • Loading branch information
yenienserrano authored and github-actions[bot] committed Feb 23, 2023
1 parent 547327a commit bb44922
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ All notable changes to the Wazuh app project will be documented in this file.

### Added

-
- 2 fields (ignore and restrict) are added in the `Management/Configuration/Log collection`. [#5203](https://github.com/wazuh/wazuh-kibana-app/pull/5203)

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ import React, { Component, Fragment } from 'react';
import WzNoConfig from '../util-components/no-config';
import WzConfigurationSettingsTabSelector from '../util-components/configuration-settings-tab-selector';
import WzConfigurationListSelector from '../util-components/configuration-settings-list-selector';
import { isString, renderValueOrDefault, renderValueOrNoValue } from '../utils/utils';
import { isString, renderValueOrNoValue } from '../utils/utils';
import { settingsListBuilder } from '../utils/builders';

import helpLinks from './help-links';
import { LOGCOLLECTOR_LOCALFILE_PROP, LOCALFILE_LOGS_PROP } from './types';

const renderTargetField = (item) => (item ? item.join(', ') : 'agent');
const renderArrayObjectField = arrayObjectField => {
const stringToRender = arrayObjectField
? arrayObjectField
.map(({ value, type }) => value?.concat(type ? ` (${type})` : ''))
.join(', ')
: '-';
return stringToRender;
};

const mainSettings = [
{ field: 'logformat', label: 'Log format' },
Expand Down Expand Up @@ -53,6 +61,16 @@ const mainSettings = [
label: 'Redirect output to this socket',
render: renderTargetField,
},
{
field: 'ignore',
label: 'If the expression matches, the log will be ignored',
render: renderArrayObjectField,
},
{
field: 'restrict',
label: 'The log will only be processed if the expression matches',
render: renderArrayObjectField,
},
];

const getMainSettingsAgentOrManager = (agent) =>
Expand Down

0 comments on commit bb44922

Please sign in to comment.