Hello,
I have a delicate problem, and I would greatly appreciate your help
I have to ingest fulllog only for certain agents,
I made the below changes , it creates indexes correctly " wazuh-archives-4.x-grupA-2023.08.25" and "wazuh-archives-4.x-grupB-2023.08.25"
But additionally it creates an index:
filebeat-7.10.2-2023.08.25
which contains all received logs
My question is, where am I going wrong, how can I stop ingesting these logs in theÂ
filebeat-7.10.2* index?
It takes up a lot of space with some logs that we don't need
---------------------------------------------
step 1 -
---------------------------------------------
in /var/ossec/etc/ossec.conf are enabled: <logall_json>yes</logall_json>
---------------------------------------------
step 2 - I created 2 groups where I added the agents for which ingestion is desired and I created labels for each grup
---------------------------------------------
<agent_config>
<labels>
<label key="grup">grupA</label>
</labels>
</agent_config>
and
<agent_config>
<labels>
<label key="grup">grupB</label>
</labels>
</agent_config>
---------------------------------------------
step 3 - in /usr/share/filebeat/module/wazuh/archives/manifest.yml
---------------------------------------------
module_version: 0.1
var:
 - name: paths
  default:
   - /var/ossec/logs/archives/archives.json
 - name: index_prefix
  default: wazuh-archives-4.x-
 - name: paths
  default:
   - /var/ossec/logs/archives/archives.json
 - name: grupA-
  default: wazuh-archives-4.x-grupA-
 - name: paths
  default:
   - /var/ossec/logs/archives/archives.json
 - name: grupB-
  default: wazuh-archives-4.x-grupB-
input: config/archives.yml
ingest_pipeline: ingest/pipeline.json
---------------------------------------------
step 4
---------------------------------------------
{
 "description": "Wazuh events pipeline",
 "processors": [
  { "json" : { "field" : "message", "add_to_root": true } },
  {
   "geoip": {
    "field": "data.srcip",
    "target_field": "GeoLocation",
    "properties": ["city_name", "country_name", "region_name", "location"],
    "ignore_missing": true,
    "ignore_failure": true
   }
  },
  {
   "geoip": {
    "field": "data.win.eventdata.ipAddress",
    "target_field": "GeoLocation",
    "properties": ["city_name", "country_name", "region_name", "location"],
    "ignore_missing": true,
    "ignore_failure": true
   }
  },
  {
   "geoip": {
    "field": "data.aws.sourceIPAddress",
    "target_field": "GeoLocation",
    "properties": ["city_name", "country_name", "region_name", "location"],
    "ignore_missing": true,
    "ignore_failure": true
   }
  },
  {
   "geoip": {
    "field": "data.gcp.jsonPayload.sourceIP",
    "target_field": "GeoLocation",
    "properties": ["city_name", "country_name", "region_name", "location"],
    "ignore_missing": true,
    "ignore_failure": true
   }
  },
  {
   "geoip": {
    "field": "data.office365.ClientIP",
    "target_field": "GeoLocation",
    "properties": ["city_name", "country_name", "region_name", "location"],
    "ignore_missing": true,
    "ignore_failure": true
   }
  },
  {
   "date": {
    "field": "timestamp",
    "target_field": "@timestamp",
    "formats": ["ISO8601"],
    "ignore_failure": false
   }
  },
  { Â
   "date_index_name": {
    "if": "ctx?.agent?.labels?.grup == 'grupA'",
    "field": "timestamp",
    "date_rounding": "d",
    "index_name_prefix": "{{fields.index_prefix}}grupA-",
    "index_name_format": "yyyy.MM.dd",
    "ignore_failure": false
   }
  },
  {
   "date_index_name": {
    "if": "ctx?.agent?.labels?.grup == 'grupB'",
    "field": "timestamp",
    "date_rounding": "d",
    "index_name_prefix": "{{fields.index_prefix}}grupB-",
    "index_name_format": "yyyy.MM.dd",
    "ignore_failure": false
   }
  },
  { "remove": { "field": "message", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "ecs", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "beat", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "input_type", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "tags", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "count", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "@version", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "log", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "offset", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "type", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "host", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "fields", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "event", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "fileset", "ignore_missing": true, "ignore_failure": true } },
  { "remove": { "field": "service", "ignore_missing": true, "ignore_failure": true } }
 ],
 "on_failure" : [{
  "drop" : { }
 }]
}
---------------------------------------------
Additionally, how can I change the logs for each group to be saved in a different file than /var/ossec/logs/archives/archives.json
for example:/var/ossec/logs/archives/archives-groupA.json and /var/ossec/logs/archives/archives-groupB.json and to ingest from these 2 new files? it is posible ?