# Logstash input exec

**URL:** https://discuss.elastic.co/t/logstash-input-exec/39312
**Category:** Logstash
**Created:** [January 15, 2016, 8:51am UTC](https://discuss.elastic.co/t/logstash-input-exec/39312 "2016-01-15T08:51:01Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![chicco\_95](https://avatars.discourse-cdn.com/v4/letter/c/ce7236/32.png) [@chicco\_95](https://discuss.elastic.co/u/chicco_95)
#### Post date: [January 15, 2016, 8:51am UTC](https://discuss.elastic.co/t/logstash-input-exec/39312/1 "2016-01-15T08:51:02Z")

</div>

Hi all,  
i have an input config which launch the exec plugin,  
the program launched generates json data output , how can I put them in a index on ES?

thank you, sorry for my English

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [January 15, 2016, 9:19am UTC](https://discuss.elastic.co/t/logstash-input-exec/39312/2 "2016-01-15T09:19:06Z")

</div>

You should be able to use the json codec to have the command output parsed as JSON and the usual elasticsearch output to send the events to ES.

```auto
input {
  exec {
    command => "..."
    codec => "json"
  }
}

```

---

<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, 5:15am UTC](https://discuss.elastic.co/t/logstash-input-exec/39312/3 "2017-07-06T05:15:37Z")

</div>


