Metricbeat single run

Hi all
Is it possible to let run metricbeat once and then terminate? So the service (everlasting process) is not wanted.

What do you mean by "run once"? Metricbeat continually grabs data.
If you want you could write a simple script that starts the service...waits for x amount of time and then stops the service.

1 Like

Yes that's the thing i need: grab data once and then terminate instead of running metricbeat continually.

If i start the service and stop it after x seconds with the script.. how big could x be?

Alternative to a fix waiting time, are there any signs that metricbeat is not just grabbing data? E.g. number of active java processes on OS level or something like that? I think I will try to find special log entries...

You could setup a rate_limit processor and set it to a large enough value so that it only sends the data once and then the script that is running terminates before the processor schedule kicks in again.

I have not tried this before but playing around with that may work. However, there is no built in startup once and shutdown option.

Also a nice idea, thanks a lot.


Why not just set the collection period to say 10m... Then it would collect once and you could stop the service before the 10m was up.

Sometimes when I see questions like this I'm not sure exactly what you're trying to accomplish.

Sometimes it helps if you just state it as I can use your story.

"As an SRE, I'd like collect the infrastructure data once so that I can get a quick check of the health of the host."

If you're really trying to just determine whether a host is up and available and some processes were running, There may be some other ways.

And yes, you can actually create an alert if metricBeat stop sending data That assumes metricbeat is running.

You can pare down metricbeat Data to be very small

So it's back to what are you really trying to accomplish.?


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