elastic / elastic-package

elastic-package - Command line tool for developing Elastic Integrations

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Validate command for benchmark templates

ruflin opened this issue · comments

When building a template for a benchmark, currently the only way to validate the template and test it, is shipping it to Elasticsearch with the stream command, for example:

elastic-package benchmark stream --benchmark error-benchmark -vv

Instead, it would be nice to be able to do multiple things with and without Elasticsearch:

  • Validate if the template can be generated
    • Validate that it is JSON
    • Validate that it works for X number of events
  • Preview output
    • Show on the console how an event looks like that is sent to Elasticsearch
  • Test sending event
    • X number of events are sent to Elasticsearch, on success, read out of ES again and printed to console with the result. In case of error, print out the full error from Elasticsearch

The above should make developing templates much quicker.

Eventually, at least the validation step should also be run as part of the check command to ensure all templates in a package are valid.

One additional thing that would be help is being able to get a sample event on how data would be shipped by elastic-agent before. I wonder if the combination of what @marc-gr did where schema A is collect, with the sample log messages we have, if there is an easy way to generate schema B? Taking schema B, the for the template only variables have to be filled in.