Hi, I want to pipe the flow data to be consumed to a file, separate from the “status logs” displaying errors etc. Any way to accomplish this? I imagine it has something to do with stdout enabled and in json format.
Want to do this to use filebeat to consume the metrics so we have backup of the raw output which is consumed to elasticsearch.
It’s not entirely clear to me what you are asking, but I think you want to send flow records to Filebeat AND Elasticsearch. Is that correct?
Also, is the “status log” you are referring to the log for the collector itself, usually written to /var/log/elastiflow/flowcoll/flowcoll.log? If so, that log would not contain any flow records.
We have a ‘standard out’ output that you could re-direct to a file, but it’s only recommended for testing and low flow volumes.
Everyone that I know that uses Filebeat, uses the Filebeat http_endpoint. You could then set up Logstash to write to both Elastic and a local file.
I’m curious to know what the value is of having a local file with raw flow records. You would most likely need to set up some sort of file rotation scheme to avoid filling the disk, and the volume and sometimes density of flow records make parsing them from file difficult. This is why we have outputs like Elasticsearch that can handle the high volume and density much more efficiently.
This may just be a temporary solution if the flow records are too heavy. For now, the focus is the same, to create a file by piping systemd or equivalent.
Though I cannot seem to get it to work. Specifying
A process only has one stdout stream, so the flow records and collector logs will be mixed. I don’t know of anyway to avoid that outside of an external script or something. This is why we specifically state that the STDOUT output is for testing only.
Your ‘StandardOutput’ setting in systemd should be done in an override file ( to prevent getting overwritten with upgrades ) and the syntax is likely something like StandardOutput=append:/var/log/elastiflow/records.log. You will also need to do a systemctl daemon-reload