I am trying to ingest JSON metric data from HTTP-Endpoints using Telegraf's HTTP Input Plugin, and write it to a Postgresql database using the Postgresql Output plugin. This is working as expected.
However, some of the JSON-Responses are very long . Since the PostgreSQL Output plugin creates a column for every field, these tables become very long and cluttered with information I don't need.
For those endpoints where the data cannot be altered at the sender's side (For example: RabbitMQ's Premade API), is there a way to filter the JSON Response in Telegraf?
For example: I have the following JSON-Response:
{
"message_stats": {
"publish": 1,
"publish_details": {
"rate": 0.0
}
}
}
I am only interested in message_stats.publish_details.rate
. I do not want message_stats.publish
to appear in my database. How can I achieve that?