# Split a document into several documents

**URL:** <https://discuss.elastic.co/t/split-a-document-into-several-documents/121506>\
**Category:** Elasticsearch\
**Created:** [February 26, 2018, 2:31pm UTC](https://discuss.elastic.co/t/split-a-document-into-several-documents/121506 "2018-02-26T14:31:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rym\_Guerbi\_Michaut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rym_guerbi_michaut/32/25496_2.png) [@Rym\_Guerbi\_Michaut](https://discuss.elastic.co/u/Rym_Guerbi_Michaut)\
**Post date:** [February 26, 2018, 2:31pm UTC](https://discuss.elastic.co/t/split-a-document-into-several-documents/121506/1 "2018-02-26T14:31:18Z")

</div>

Hi there,

I have a single document loaded in elasticsearch and I'd like to split it into several documents on the "user" field.

I've tried doing it with Logstash filters but it didn't work.

The document contains a lot of nested objects and looks like this:

```auto
{
  "user": [
    {
      "week": {
        "type": "nested",
        "timespent": {"type": "float"},
        "timespentinterne": {"type": "float"},
        "percentintern": {"type": "text"},
        "worklogs": {
			"type": "nested",
			"KFIT2K18-16": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-15": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-14": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-13": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-12": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-11": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-10": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-9": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-8": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-7": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-6": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-5": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-4": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-3": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-2": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}},
			"KFIT2K18-1": {
				"type": "nested","worklogsdetails": [{"type": "nested","timespent": "float","commentairewl": "text","authorKey": "keyword","issueKey": "text","datewl": "float","dateReadablewl": "date"}],"TimespentOnIssue": {"type": "float"}
          }
        }
      }
    }
  ]
}

```

Could anyone help please?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [March 26, 2018, 2:31pm UTC](https://discuss.elastic.co/t/split-a-document-into-several-documents/121506/2 "2018-03-26T14:31:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
