# Filebeat monitoring and sending logs to Elasticsearch

**URL:** <https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [August 7, 2018, 6:29am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242 "2018-08-07T06:29:08Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Priyaranjan\_Mudliar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyaranjan_mudliar/32/33726_2.png) [@Priyaranjan\_Mudliar](https://discuss.elastic.co/u/Priyaranjan_Mudliar)\
**Post date:** [August 7, 2018, 6:29am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/1 "2018-08-07T06:29:08Z")

</div>

Is it possible to run a batch script when i encounter a "Error" word in any of the log lines which is monitored by filebeat and is sent to elasticsearch.

Can someone please help me on this? Any leads would be appreciated 🙂

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 7, 2018, 2:45pm UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/2 "2018-08-07T14:45:34Z")

</div>

Hi @Priyaranjan_Mudliar,

It is not possible to run scripts from filebeat. What are you trying to achieve?

---

<div class="post-metadata">

**Author:** ![chandra0651](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chandra0651/32/30484_2.png) [@chandra0651](https://discuss.elastic.co/u/chandra0651)\
**Post date:** [August 7, 2018, 4:15pm UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/3 "2018-08-07T16:15:46Z")

</div>

I think you can exclude the logs which are other than ERROR using exclude lines and ingest only error logs.use some thing like below in filebeat prospectors. It worked for me.

> exclude\_lines: ['._?(DEBUG|INFO)._']

---

<div class="post-metadata">

**Author:** ![Priyaranjan\_Mudliar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyaranjan_mudliar/32/33726_2.png) [@Priyaranjan\_Mudliar](https://discuss.elastic.co/u/Priyaranjan_Mudliar)\
**Post date:** [August 8, 2018, 6:08am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/4 "2018-08-08T06:08:59Z")

</div>

@jsoriano i am trying to add local machine timestamp to my output whenever filebeat reads an "Error" word in my "message" field.

---

<div class="post-metadata">

**Author:** ![jsoriano](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jsoriano/32/27920_2.png) [@jsoriano](https://discuss.elastic.co/u/jsoriano)\
**Post date:** [August 8, 2018, 10:00am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/5 "2018-08-08T10:00:18Z")

</div>

Timestamp is always added to the events shipped by filebeat 🤔

In general to modify events you can use processors and/or an [ingest pipeline](https://www.elastic.co/guide/en/beats/filebeat/6.3/configuring-ingest-node.html).

---

<div class="post-metadata">

**Author:** ![Priyaranjan\_Mudliar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/priyaranjan_mudliar/32/33726_2.png) [@Priyaranjan\_Mudliar](https://discuss.elastic.co/u/Priyaranjan_Mudliar)\
**Post date:** [August 8, 2018, 10:22am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/6 "2018-08-08T10:22:38Z")

</div>

@jsoriano but the timestamp is in UTC and i want to add the local time instead of UTC

---

<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:** [September 5, 2018, 10:22am UTC](https://discuss.elastic.co/t/filebeat-monitoring-and-sending-logs-to-elasticsearch/143242/7 "2018-09-05T10:22:39Z")

</div>

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