# Can I write extracted JSON field from response body to simulation.log

**URL:** <https://community.gatling.io/t/can-i-write-extracted-json-field-from-response-body-to-simulation-log/748>\
**Category:** Gatling (Open-Source)\
**Created:** [December 26, 2013, 8:02am UTC](https://community.gatling.io/t/can-i-write-extracted-json-field-from-response-body-to-simulation-log/748 "2013-12-26T08:02:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Xiaowei\_Zhou](https://avatars.discourse-cdn.com/v4/letter/x/f475e1/32.png) [@Xiaowei\_Zhou](https://community.gatling.io/u/Xiaowei_Zhou)\
**Post date:** [December 26, 2013, 8:02am UTC](https://community.gatling.io/t/can-i-write-extracted-json-field-from-response-body-to-simulation-log/748/1 "2013-12-26T08:02:43Z")

</div>

Hi,

I am using Gatling 1.5.3

With ‘jsonPath’ I can extract JSON fields and with ‘responseInfoExtractor’ I can write custom information to simulation.log. I know how to write the whole response body to simulation.log, but what I really want is writing only one field extracted from the response body using JSON path to the log file. Is that possible?

Thank you very much!

Xiaowei Zhou

---

<div class="post-metadata">

**Author:** ![Excilys](https://avatars.discourse-cdn.com/v4/letter/e/8797f3/32.png) [@Excilys](https://community.gatling.io/u/Excilys)\
**Post date:** [December 26, 2013, 9:48am UTC](https://community.gatling.io/t/can-i-write-extracted-json-field-from-response-body-to-simulation-log/748/2 "2013-12-26T09:48:58Z")

</div>

Hi,

That’s not possible with extraInfoExtractor in Gatling 1 as it doesn’t have access to the session. It is in Gatling 2 as the signature has changed.  
You’d have to write into your own file, not simulation.log, with a exec(function).

Cheers,

Stéphane
