# Invalid TOML when including \[\[processors.starlark\]\]

**URL:** <https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511>\
**Category:** Telegraf\
**Created:** [June 8, 2024, 7:48pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511 "2024-06-08T19:48:37Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sambabic](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sambabic/32/15919_2.png) [@sambabic](https://community.influxdata.com/u/sambabic)\
**Post date:** [June 8, 2024, 7:48pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511/1 "2024-06-08T19:48:37Z")

</div>

I’ve included just the simple stub section with apply function in the configuration file and upon reading configuration I get an Invalid TOML error always at the last line even if it is a blank line. This only happens when I include the starlark processor.

ex:  
[[processors.starlark]]  
source = ‘’’  
def apply(metric):  
return metric

It’s like it is treating the embedded script as TOML which it isn’t obviously, its python(ie)

Thanks

---

<div class="post-metadata">

**Author:** ![sambabic](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sambabic/32/15919_2.png) [@sambabic](https://community.influxdata.com/u/sambabic)\
**Post date:** [June 8, 2024, 7:53pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511/2 "2024-06-08T19:53:30Z")

</div>

Ugh. I think I may have just answered my own question. In much of the documentation it always shows the source = ‘’’ at the head but doesn’t show the trailing ‘’‘, makes perfect sense now cause it is an embedded script. It’s just that many of the examples shows the former ‘’’ and not the latter ‘’’ and take for granted everyone knows that it is escaping the internal script. Let’s see if this works 🙂

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [June 10, 2024, 1:22pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511/3 "2024-06-10T13:22:15Z")

</div>

> [@sambabic](#):
>
> but doesn’t show the trailing ‘’‘

Can you please link to one of these examples missing the trailing quotes?

---

<div class="post-metadata">

**Author:** ![sambabic](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/sambabic/32/15919_2.png) [@sambabic](https://community.influxdata.com/u/sambabic)\
**Post date:** [June 10, 2024, 6:16pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511/4 "2024-06-10T18:16:28Z")

</div>

Most of the examples here do not include it:

> **[How to Use Starlark with Telegraf](https://www.influxdata.com/blog/how-use-starlark-telegraf/)**
>
> How to use Starlark in Telegraf to process time series data before it's sent to InfluxDB plus code for calculating ratios, renaming tags, conditional logic.

I think the only example that does include the termination is the namepass example that demonstrates having two scripts. Because it has two scripts the top script is terminated, but the bottom script termination is cut off.

---

<div class="post-metadata">

**Author:** ![jpowers](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/jpowers/32/8569_2.png) [@jpowers](https://community.influxdata.com/u/jpowers)\
**Post date:** [June 10, 2024, 6:29pm UTC](https://community.influxdata.com/t/invalid-toml-when-including-processors-starlark/34511/5 "2024-06-10T18:29:55Z")

</div>

Thanks I’ll follow up with marketing to update that blog post. That is definitely misleading as-is.
