magnusbaeck / logstash-filter-verifier

Apache License 2.0
192 stars 27 forks source link

Support for value of object type #12

Closed breml closed 7 years ago

breml commented 7 years ago

Currently values of object type are not supported by logstash-filter-verifier. In my use case I test a Logstash filter configuration, which processes data shipped by filebeat. Filebeat adds some parts of the provided data in nested fields. To simulate this data within logstash-filter-verifier it would be required to have support for values of object type.

Relevant part of an event, shipped by filebeat:

"beat": {
  "hostname": "3f7cf95a-b816-41a5-80a6-a2a017914bb9",
  "name": "elasticsearch.logstash.9b58899d-61ef-42f5-bbd1-43bfbf39f9dd"
},

To add this information to every event in logstash-filter-verifier, it would be nice to be able to use the following configuration:

{
  "fields": {
    "beat": {
      "hostname": "3f7cf95a-b816-41a5-80a6-a2a017914bb9",
      "name": "elasticsearch.logstash.9b58899d-61ef-42f5-bbd1-43bfbf39f9dd"
    }
  },
  "input": [ ],
  "expected": [ ]
}

As a workaround one could do the following:

{
  "fields": {
    "[beat][hostname]": "3f7cf95a-b816-41a5-80a6-a2a017914bb9",
    "[beat][name]": "elasticsearch.logstash.9b58899d-61ef-42f5-bbd1-43bfbf39f9dd"
    }
  },
  "input": [ ],
  "expected": [ ]
}