How to send a piece of command to es automatic by es when es just started?

Hi, for es cancel river service in es 2.x. River service begin to start after ES started. Now I need the function as river service. How can I do?

You can have a look at logstash and/or beats.

logstash and/or beats can not do any thing. such as myself plugin. I hope it can send command to my plugin when es starts.

Why not writing a beat plugin?

I have completed the plugin' development that can synchronize data from mongodb to es. It will synchronize data from mongodb to es immediately when mongodb changes. now. I need es send a piece of command to monitor mongodb's state when es starts. maybe beats could not get my requirement, is it?

You could write a mongodb beat if you wish. That said, packetbeat already listen to what is happening at a network level to your mongodb instance.

Might do part of the job you are looking for?

Think about beat as the E part of ETL. It collects data.

I see. It's a good idea. maybe I will abandoned my achievement in es' plugin. I will study beat. thank you very much.