Search code examples
elasticsearchkibana

How to create mass amounts of test data in elasticsearch / Kibana


I need to test some logic I have written in Kibana (Vega scripts). For this I require quite a bit of data to generate the graphs. I am currently doing this manually wiht statements such as:

post /metrics-hardware-xxx/_doc {"@timestamp":"2023-03-11T15:00", "system_Status": 1 } post /metrics-hardware-xxx/_doc {"@timestamp":"2023-03-11T15:01", "system_Status": 1 } post /metrics-hardware-xxx/_doc {"@timestamp":"2023-03-11T15:02", "system_Status": 0 }

BUt I would like to have some kind of for loop where I can loop through timestamps 1 per minute over several days and assign a random system status either 0,1,2.

Is this possible in Elastic?

It is straightforward with a stored procedure in most sql DBs, but I am not sure where to start , and seems there is not much info on the web.


Solution

  • I asked ElasticSearch support directly and their answer confirms comment from @Paulo . It seems it is impossible to do that directly in Elastic, they recommend:

    1. use one of the available client API (Python, c#, java...)
    2. use Curl requests
    3. use the PostMan application

    I have decided to use the c# client which seems to be the most flexible.