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

**URL:** <https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930>\
**Category:** Elasticsearch\
**Created:** [April 20, 2016, 3:28pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930 "2016-04-20T15:28:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![focuslihong](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@focuslihong](https://discuss.elastic.co/u/focuslihong)\
**Post date:** [April 20, 2016, 3:28pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/1 "2016-04-20T15:28:32Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 20, 2016, 4:49pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/2 "2016-04-20T16:49:09Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![focuslihong](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@focuslihong](https://discuss.elastic.co/u/focuslihong)\
**Post date:** [April 23, 2016, 2:52pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/3 "2016-04-23T14:52:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 23, 2016, 3:50pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/4 "2016-04-23T15:50:59Z")

</div>

Why not writing a beat plugin?

---

<div class="post-metadata">

**Author:** ![focuslihong](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@focuslihong](https://discuss.elastic.co/u/focuslihong)\
**Post date:** [April 23, 2016, 4:02pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/5 "2016-04-23T16:02:54Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 23, 2016, 5:55pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/6 "2016-04-23T17:55:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![focuslihong](https://avatars.discourse-cdn.com/v4/letter/f/e99b99/32.png) [@focuslihong](https://discuss.elastic.co/u/focuslihong)\
**Post date:** [April 23, 2016, 6:23pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/7 "2016-04-23T18:23:53Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 5, 2017, 10:56pm UTC](https://discuss.elastic.co/t/how-to-send-a-piece-of-command-to-es-automatic-by-es-when-es-just-started/47930/8 "2017-07-05T22:56:48Z")

</div>


