# Can Native scripts do search while "Calculating"?

**URL:** <https://discuss.elastic.co/t/can-native-scripts-do-search-while-calculating/18056>\
**Category:** Elasticsearch\
**Created:** [June 12, 2014, 1:49am UTC](https://discuss.elastic.co/t/can-native-scripts-do-search-while-calculating/18056 "2014-06-12T01:49:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antonio\_Augusto\_Sant](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/antonio_augusto_sant/32/82851_2.png) [@Antonio\_Augusto\_Sant](https://discuss.elastic.co/u/Antonio_Augusto_Sant)\
**Post date:** [June 12, 2014, 1:49am UTC](https://discuss.elastic.co/t/can-native-scripts-do-search-while-calculating/18056/1 "2014-06-12T01:49:50Z")

</div>

For starts I've never write a script on ElasticSearch, but I'm interested  
in knowing if I can write a script that, when run, will do a search on then  
ElasticSearch cluster. This search would be based on the fields of the doc  
on which the script would be running. I can imagine that it would have a  
TERRIBLE performance hit on the query since all the searches taking place,  
but it might be worth it.

If this is possible it might be possible to cross reference different  
indexes/document types on the same search.  
Log monitoring is my field of interest, so, with this I could, for example:  
look for users that have failed login attemps with SSH (syslog log), and  
look if the machine that originated the attemps also tried connecting  
somewhere else (iptables logs). I could put the script on a sum  
aggregation, for example, so I'd have something like: machine A tried  
connecting to XXXX other machines, machine B tried connecting to YYYY other  
machines ...

Thanks

--  
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/7fa38c48-f906-4d91-b9db-3f4f1764fc66%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/7fa38c48-f906-4d91-b9db-3f4f1764fc66%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, 1:23am UTC](https://discuss.elastic.co/t/can-native-scripts-do-search-while-calculating/18056/2 "2017-07-06T01:23:08Z")

</div>


