# Pipeline Issue - set\_fields w/ JSON not working

**URL:** <https://community.graylog.org/t/pipeline-issue-set-fields-w-json-not-working/12591>\
**Category:** Graylog Central (peer support)\
**Tags:** sidecar, filebeat-windows\
**Created:** [November 1, 2019, 9:49pm UTC](https://community.graylog.org/t/pipeline-issue-set-fields-w-json-not-working/12591 "2019-11-01T21:49:14Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)\
**Post date:** [November 4, 2019, 8:41am UTC](https://community.graylog.org/t/pipeline-issue-set-fields-w-json-not-working/12591/2 "2019-11-04T08:41:45Z")

</div>

a really simple json parser is something like:

```auto
rule "extract-json"
when
    starts_with(to_string($message.message), "{") && ends_with(to_string($message.message), "}")
then
    let json = parse_json(to_string($message.message));
    let map = to_map(json);
    set_fields(map);
end

```

Not sure why this is not working in your case - from my knowledge it should.

Which Graylog version are you using?

---

_[View the full topic](https://community.graylog.org/t/pipeline-issue-set-fields-w-json-not-working/12591)._
