# Writing custom scripts for indexing data in Elasticsearch

**URL:** <https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559>\
**Category:** Elasticsearch\
**Created:** [January 9, 2015, 1:45pm UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559 "2015-01-09T13:45:09Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 9, 2015, 1:45pm UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/1 "2015-01-09T13:45:09Z")

</div>

Hi,

I'm a newbie to Elasticsearch, and I would like to know about writing  
custom scripts in Elasticsearch. Basically, I want to have a script which  
takes a table name and the columns in it as parameters, and would then  
start a JDBC river plugin and index the corresponding data into my  
Elasticsearch. Basically, I'm kind of looking for a mechanism through which  
I can automatically index data into my Elasticsearch on just specifying my  
required table and columns. And I would very much like to know if this  
viable and also any other ideas through which I could implement this?

Thank you.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 10, 2015, 6:45pm UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/2 "2015-01-10T18:45:58Z")

</div>

If you can set up shell scripting, it should be viable to define a curl  
command in a script that copies the table and columns into an SQL statement  
and performs something similar to step 7 in

> **[Quickstart](https://github.com/jprante/elasticsearch-jdbc/wiki/Quickstart)**
>
> JDBC importer for Elasticsearch. Contribute to jprante/elasticsearch-jdbc development by creating an account on GitHub.

Jörg

On Fri, Jan 9, 2015 at 2:45 PM, Amtul Nazneen [amtulnazneen7@gmail.com](mailto:amtulnazneen7@gmail.com)  
wrote:

> Hi,
> 
> I'm a newbie to Elasticsearch, and I would like to know about writing  
> custom scripts in Elasticsearch. Basically, I want to have a script which  
> takes a table name and the columns in it as parameters, and would then  
> start a JDBC river plugin and index the corresponding data into my  
> Elasticsearch. Basically, I'm kind of looking for a mechanism through which  
> I can automatically index data into my Elasticsearch on just specifying my  
> required table and columns. And I would very much like to know if this  
> viable and also any other ideas through which I could implement this?
> 
> Thank you.
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEr02XoB%3Dh1bE7qko7HSavJKZm7Zp5EYNg\_aifwQMi%2B4g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoEr02XoB%3Dh1bE7qko7HSavJKZm7Zp5EYNg_aifwQMi%2B4g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 12, 2015, 5:23am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/3 "2015-01-12T05:23:47Z")

</div>

Thank you. I have a doubt though, once I run the script, the river plugin  
is started and the data gets indexed into Elasticsearch, I want to know, if  
the plugin would be running after that, or does it stop once the script  
execution comes to an end?

On Sunday, January 11, 2015 at 12:16:05 AM UTC+5:30, Jörg Prante wrote:

> If you can set up shell scripting, it should be viable to define a curl  
> command in a script that copies the table and columns into an SQL statement  
> and performs something similar to step 7 in  
> [Quickstart · jprante/elasticsearch-jdbc Wiki · GitHub](https://github.com/jprante/elasticsearch-river-jdbc/wiki/Quickstart)
> 
> Jörg
> 
> On Fri, Jan 9, 2015 at 2:45 PM, Amtul Nazneen \<[amtuln...@gmail.com](mailto:amtuln...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi,
> > 
> > I'm a newbie to Elasticsearch, and I would like to know about writing  
> > custom scripts in Elasticsearch. Basically, I want to have a script which  
> > takes a table name and the columns in it as parameters, and would then  
> > start a JDBC river plugin and index the corresponding data into my  
> > Elasticsearch. Basically, I'm kind of looking for a mechanism through which  
> > I can automatically index data into my Elasticsearch on just specifying my  
> > required table and columns. And I would very much like to know if this  
> > viable and also any other ideas through which I could implement this?
> > 
> > Thank you.
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/f2c89e51-f690-433e-b320-f18659958eee%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e66698ab-cef9-4e91-bdc4-db0c5e4d3a72%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e66698ab-cef9-4e91-bdc4-db0c5e4d3a72%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 12, 2015, 5:24am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/4 "2015-01-12T05:24:28Z")

</div>

Thank you. I have a doubt though, once I run the script, the river plugin  
is started and the data gets indexed into Elasticsearch, I want to know, if  
the plugin would be running after that, or does it stop once the script  
execution comes to an end?

> 

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/72e9e2e1-20fe-460d-afed-98527b7004ec%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/72e9e2e1-20fe-460d-afed-98527b7004ec%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Ed\_Kim](https://avatars.discourse-cdn.com/v4/letter/e/53a042/32.png) [@Ed\_Kim](https://discuss.elastic.co/u/Ed_Kim)\
**Post date:** [January 12, 2015, 7:53am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/5 "2015-01-12T07:53:08Z")

</div>

It executes once. You could consider running that script on a schedule and  
doing incremental updates using timestamps.

On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:

> Thank you. I have a doubt though, once I run the script, the river plugin  
> is started and the data gets indexed into Elasticsearch, I want to know, if  
> the plugin would be running after that, or does it stop once the script  
> execution comes to an end?
> 
> >

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/e671b48a-a57d-4917-a9ac-c23face41f43%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/e671b48a-a57d-4917-a9ac-c23face41f43%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 14, 2015, 5:01am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/6 "2015-01-14T05:01:19Z")

</div>

Ohkay. So the river runs only once when the script starts? And after that  
won't it be running in the background to fetch the updates according to a  
schedule?

On Monday, January 12, 2015 at 1:23:08 PM UTC+5:30, Ed Kim wrote:

> It executes once. You could consider running that script on a schedule and  
> doing incremental updates using timestamps.
> 
> On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:
> 
> > Thank you. I have a doubt though, once I run the script, the river plugin  
> > is started and the data gets indexed into Elasticsearch, I want to know, if  
> > the plugin would be running after that, or does it stop once the script  
> > execution comes to an end?
> > 
> > >

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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:** [January 14, 2015, 9:00am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/7 "2015-01-14T09:00:47Z")

</div>

I guess you need to set interval. See doc plugin on the home page of the JDBC river.

interval - a time value for the delay between two river runs (default: not set)

--  
David 😉  
Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs

> Le 14 janv. 2015 à 06:01, Amtul Nazneen [amtulnazneen7@gmail.com](mailto:amtulnazneen7@gmail.com) a écrit :
> 
> Ohkay. So the river runs only once when the script starts? And after that won't it be running in the background to fetch the updates according to a schedule?
> 
> > On Monday, January 12, 2015 at 1:23:08 PM UTC+5:30, Ed Kim wrote:  
> > It executes once. You could consider running that script on a schedule and doing incremental updates using timestamps.
> > 
> > > On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:  
> > > Thank you. I have a doubt though, once I run the script, the river plugin is started and the data gets indexed into Elasticsearch, I want to know, if the plugin would be running after that, or does it stop once the script execution comes to an end?
> > > 
> > > >
> 
> --  
> You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/BC10D79E-335C-4D89-8F41-EE95FCDAA464%40pilato.fr](https://groups.google.com/d/msgid/elasticsearch/BC10D79E-335C-4D89-8F41-EE95FCDAA464%40pilato.fr).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 16, 2015, 10:12am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/8 "2015-01-16T10:12:54Z")

</div>

Thank you. Is it the "interval" parameter or "schedule" parameter? If I set  
the schedule parameter, then the Elasticsearch will poll the tables  
accordingly right?

On Wednesday, January 14, 2015 at 2:31:07 PM UTC+5:30, David Pilato wrote:

> I guess you need to set interval. See doc plugin on the home page of the  
> JDBC river.
> 
> interval - a time value for the delay between two river runs (default:  
> not set)
> 
> --  
> David 😉  
> Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> 
> Le 14 janv. 2015 à 06:01, Amtul Nazneen \<[amtuln...@gmail.com](mailto:amtuln...@gmail.com) \<javascript:\>\>  
> a écrit :
> 
> Ohkay. So the river runs only once when the script starts? And after that  
> won't it be running in the background to fetch the updates according to a  
> schedule?
> 
> On Monday, January 12, 2015 at 1:23:08 PM UTC+5:30, Ed Kim wrote:
> 
> > It executes once. You could consider running that script on a schedule  
> > and doing incremental updates using timestamps.
> > 
> > On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:
> > 
> > > Thank you. I have a doubt though, once I run the script, the river  
> > > plugin is started and the data gets indexed into Elasticsearch, I want to  
> > > know, if the plugin would be running after that, or does it stop once the  
> > > script execution comes to an end?
> > > 
> > > > --  
> > > > You received this message because you are subscribed to the Google Groups  
> > > > "elasticsearch" group.  
> > > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > > To view this discussion on the web visit  
> > > > [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com)  
> > > > [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > .  
> > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [January 16, 2015, 12:57pm UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/9 "2015-01-16T12:57:40Z")

</div>

"schedule" is triggering the JDBC plugin by wall clock time of the machine,  
where "interval" simply waits the given time period between two runs.

Jörg

On Fri, Jan 16, 2015 at 11:12 AM, Amtul Nazneen [amtulnazneen7@gmail.com](mailto:amtulnazneen7@gmail.com)  
wrote:

> Thank you. Is it the "interval" parameter or "schedule" parameter? If I  
> set the schedule parameter, then the Elasticsearch will poll the tables  
> accordingly right?
> 
> On Wednesday, January 14, 2015 at 2:31:07 PM UTC+5:30, David Pilato wrote:
> 
> > I guess you need to set interval. See doc plugin on the home page of the  
> > JDBC river.
> > 
> > interval - a time value for the delay between two river runs (default:  
> > not set)
> > 
> > --  
> > David 😉  
> > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > 
> > Le 14 janv. 2015 à 06:01, Amtul Nazneen [amtuln...@gmail.com](mailto:amtuln...@gmail.com) a écrit :
> > 
> > Ohkay. So the river runs only once when the script starts? And after that  
> > won't it be running in the background to fetch the updates according to a  
> > schedule?
> > 
> > On Monday, January 12, 2015 at 1:23:08 PM UTC+5:30, Ed Kim wrote:
> > 
> > > It executes once. You could consider running that script on a schedule  
> > > and doing incremental updates using timestamps.
> > > 
> > > On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:
> > > 
> > > > Thank you. I have a doubt though, once I run the script, the river  
> > > > plugin is started and the data gets indexed into Elasticsearch, I want to  
> > > > know, if the plugin would be running after that, or does it stop once the  
> > > > script execution comes to an end?
> > > > 
> > > > > --  
> > > > > You received this message because you are subscribed to the Google Groups  
> > > > > "elasticsearch" group.  
> > > > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%  
> > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > .  
> > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > --  
> > You received this message because you are subscribed to the Google Groups  
> > "elasticsearch" group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFXKhuNY54R4UAVAw%2Bo8eYVshQiqmuQgHaPjY7qd2f6Zw%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFXKhuNY54R4UAVAw%2Bo8eYVshQiqmuQgHaPjY7qd2f6Zw%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![4m7u1](https://avatars.discourse-cdn.com/v4/letter/4/8e7dd6/32.png) [@4m7u1](https://discuss.elastic.co/u/4m7u1)\
**Post date:** [January 19, 2015, 6:56am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/10 "2015-01-19T06:56:33Z")

</div>

Thank you 🙂

On Friday, January 16, 2015 at 6:27:48 PM UTC+5:30, Jörg Prante wrote:

> "schedule" is triggering the JDBC plugin by wall clock time of the  
> machine, where "interval" simply waits the given time period between two  
> runs.
> 
> Jörg
> 
> On Fri, Jan 16, 2015 at 11:12 AM, Amtul Nazneen \<[amtuln...@gmail.com](mailto:amtuln...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Thank you. Is it the "interval" parameter or "schedule" parameter? If I  
> > set the schedule parameter, then the Elasticsearch will poll the tables  
> > accordingly right?
> > 
> > On Wednesday, January 14, 2015 at 2:31:07 PM UTC+5:30, David Pilato wrote:
> > 
> > > I guess you need to set interval. See doc plugin on the home page of the  
> > > JDBC river.
> > > 
> > > interval - a time value for the delay between two river runs (default:  
> > > not set)
> > > 
> > > --  
> > > David 😉  
> > > Twitter : @dadoonet / @elasticsearchfr / @scrutmydocs
> > > 
> > > Le 14 janv. 2015 à 06:01, Amtul Nazneen [amtuln...@gmail.com](mailto:amtuln...@gmail.com) a écrit :
> > > 
> > > Ohkay. So the river runs only once when the script starts? And after  
> > > that won't it be running in the background to fetch the updates according  
> > > to a schedule?
> > > 
> > > On Monday, January 12, 2015 at 1:23:08 PM UTC+5:30, Ed Kim wrote:
> > > 
> > > > It executes once. You could consider running that script on a schedule  
> > > > and doing incremental updates using timestamps.
> > > > 
> > > > On Sunday, January 11, 2015 at 9:24:28 PM UTC-8, Amtul Nazneen wrote:
> > > > 
> > > > > Thank you. I have a doubt though, once I run the script, the river  
> > > > > plugin is started and the data gets indexed into Elasticsearch, I want to  
> > > > > know, if the plugin would be running after that, or does it stop once the  
> > > > > script execution comes to an end?
> > > > > 
> > > > > > --  
> > > > > > You received this message because you are subscribed to the Google  
> > > > > > Groups "elasticsearch" group.  
> > > > > > To unsubscribe from this group and stop receiving emails from it, send  
> > > > > > an email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com).  
> > > > > > To view this discussion on the web visit [https://groups.google.com/d/](https://groups.google.com/d/)  
> > > > > > msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%  
> > > > > > [40googlegroups.com](http://40googlegroups.com)  
> > > > > > [https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/a0997950-4ca4-4036-9550-d1da3816b503%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > > > > .  
> > > > > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > > 
> > > --  
> > > You received this message because you are subscribed to the Google Groups  
> > > "elasticsearch" group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/9db75940-2ca3-4140-a681-cba55ac3725a%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/2c72317f-1d59-4b12-955a-5c990b2491ee%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/2c72317f-1d59-4b12-955a-5c990b2491ee%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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 6, 2017, 12:38am UTC](https://discuss.elastic.co/t/writing-custom-scripts-for-indexing-data-in-elasticsearch/21559/11 "2017-07-06T00:38:06Z")

</div>


