# How do I insert multiple measurements when using the exec input plugin?

**URL:** <https://community.influxdata.com/t/how-do-i-insert-multiple-measurements-when-using-the-exec-input-plugin/9228>\
**Category:** Systems\
**Created:** [March 29, 2019, 5:59pm UTC](https://community.influxdata.com/t/how-do-i-insert-multiple-measurements-when-using-the-exec-input-plugin/9228 "2019-03-29T17:59:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bloorp](https://avatars.discourse-cdn.com/v4/letter/b/f1d935/32.png) [@Bloorp](https://community.influxdata.com/u/Bloorp)\
**Post date:** [March 29, 2019, 5:59pm UTC](https://community.influxdata.com/t/how-do-i-insert-multiple-measurements-when-using-the-exec-input-plugin/9228/1 "2019-03-29T17:59:43Z")

</div>

I am attempting to pull information from my UPS into InfluxDB. I can get various points of data using `upsc <upsname>` on the command line. This returns about 30-35 lines of data.

The examples I’ve found to build a custom plugin for telegraf uses the [exec](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/exec) plugin, but it looks like this requires each individual command to return a single line of data.

How can I structure my plugin (written in python, if it matters) to return data for 35 different datapoints using the exec plugin?

In the plugin example provided by Influx, their command outputs a single echo’d line:

```
'example,tag1=a,tag2=b i=42i,j=43i,k=44i'

```

I need this sort of thing, but for each of these entries:

```
battery.charge: 100
battery.runtime: 2622
battery.voltage: 26.3
battery.voltage.nominal: 24.0

```

I would want to use various echo lines like this:

```
'ups,ups=ups1 battery.charge=100'
'ups,ups=ups1 battery.runtime=2662'
'ups,ups=ups1 battery.voltage=26.3'
'ups,ups=ups1 battery.nominal=24.0'

```

None of the examples I’ve found return more than a single line of data when using this exec plugin. Do I need an individual script for each data point or can I return multiple data points from a single script?

---

<div class="post-metadata">

**Author:** ![Manish11576](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/manish11576/32/3053_2.png) [@Manish11576](https://community.influxdata.com/u/Manish11576)\
**Post date:** [May 11, 2020, 12:07pm UTC](https://community.influxdata.com/t/how-do-i-insert-multiple-measurements-when-using-the-exec-input-plugin/9228/2 "2020-05-11T12:07:30Z")

</div>

Hi Dear,

I am also facing the similar issue, i can see output in the telegraf plugin but showing only single field.

Please advise how to resolve this.

regards,

Manishh
