Detect when the setup command was already executed on a machine

Hi there. I am working on some PowerShell DSC configurations which include installation and setup of Filebeat.
In general everything works fine, but I am struggling to find a way to detect if the setup command was already executed on the machine. This is important to DSC so it can know whether the machine is actually in the desired state or not.
I would like to avoid creating a dummy file for detection, so I was wondering if there was some command or maybe an API call to detect if a node id/hostname has been already set up.

I am quite new to everything related to ElasticStack, so this might come from not completely getting all the concepts of what the setup command does.

With setup would you mean like the "filebeat setup" command or just the installation of filebeat?

The first one is only needed to be run once anywhere, and is not required to be run on each host, as the setup command simply prepares Elasticsearch and kibana with its relevant resources.

On another note, if you want to just confirm filebeat is working as intended, and you didn't mean the above setup command, you can run "filebeat test output", which tries to ping the configured Elasticsearch output.

Yes, I was referring to the filebeat setup command.
My understanding was that it had to be done once per host. It is clear now that running it in only one host will be enough.

However, I face the same situation for the host which will run the command.
Is there a way of checking if these relevant resources already exist? Let's say another filebeat command/flag or an API call to Elasticsearch?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.