# User session exports to Elasticsearch 8

**URL:** <https://community.dynatrace.com/t/user-session-exports-to-elasticsearch-8/34219>\
**Category:** Real User Monitoring\
**Tags:** user-sessions\
**Created:** [February 21, 2022, 1:44pm UTC](https://community.dynatrace.com/t/user-session-exports-to-elasticsearch-8/34219 "2022-02-21T13:44:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ydr](https://avatars.discourse-cdn.com/v4/letter/y/8e7dd6/32.png) [@ydr](https://community.dynatrace.com/u/ydr)\
**Post date:** [February 21, 2022, 1:44pm UTC](https://community.dynatrace.com/t/user-session-exports-to-elasticsearch-8/34219/1 "2022-02-21T13:44:30Z")

</div>

Hello,

We trying to use “user Session export” with&nbsp; Elasticsearch 8 referring to&nbsp; User session export feature:

[https://www.dynatrace.com/support/help/shortlink/session-export-httpWe](https://www.dynatrace.com/support/help/shortlink/session-export-httpWe) got automaticly the 400 error when we try the export test.  
After some searches, we found that Elasticsearch 8 no longer use&nbsp;mapping types. So if we send a sample export data like this :{ “index” : { “\_index” : “my-index”, “\_type” : “\_doc”, “\_id” : “umsaywsjuo-744377345-1622107543233” } }  
{“tenantId”:“umsaywsjuo”,“userSessionId”:“744377345”,“startTime”:1622107543233,“endTime”:1622107578205,“duration”:34972,“internalUserId”:“744377345”,“userType”:“SYNTHETIC”,“applicationType”:“WEB\_APPLICATION”,“bounce”:false,“newUser”:true,“userActionCount”:12,“totalErrorCount”:5,“totalLicenseCreditCount”:0,“matchingConversionGoalsCount”:0,“…Elasticsearch reject the data because --\> “\_type” : “\_doc"If we remove “\_type”:”\_doc” from the data, so the Data are accepted by the server.All data automaticly sent by Dynatrace include : “\_type”:“\_doc"So is there any solution to remove “\_type”:”\_doc" ?Thanks for your help.

---

<div class="post-metadata">

**Author:** ![mgome](https://avatars.discourse-cdn.com/v4/letter/m/958977/32.png) [@mgome](https://community.dynatrace.com/u/mgome)\
**Post date:** [February 21, 2022, 6:17pm UTC](https://community.dynatrace.com/t/user-session-exports-to-elasticsearch-8/34219/2 "2022-02-21T18:17:04Z")

</div>

You could send the output through logstash, remove the field and then output to elasticsearch.

filter {  
&nbsp; mutate {  
&nbsp; &nbsp; remove\_field =\> [“\_type”]  
&nbsp; }  
}

---

<div class="post-metadata">

**Author:** ![Candra](https://avatars.discourse-cdn.com/v4/letter/c/f6c823/32.png) [@Candra](https://community.dynatrace.com/u/Candra)\
**Post date:** [December 11, 2023, 5:23pm UTC](https://community.dynatrace.com/t/user-session-exports-to-elasticsearch-8/34219/3 "2023-12-11T17:23:42Z")

</div>

Since I just got the same problem, I’ll share an update for the solution that I found  
As explained in the doc below, you just need to keep the field “Type of documents in the Elasticsearch index”&nbsp;in the setting empty. Elastic 8 will not reject it anymore

> **[Export user sessions in RUM Classic](https://docs.dynatrace.com/docs/observe/digital-experience/rum-classic/session-segmentation/export-session-data)**
>
> Set up Dynatrace to export user session data to a provided webhook endpoint.
