# Invalid value for MonthOfYear and nested JSON mapping

**URL:** <https://discuss.elastic.co/t/invalid-value-for-monthofyear-and-nested-json-mapping/270019>\
**Category:** Elasticsearch\
**Created:** [April 13, 2021, 2:02pm UTC](https://discuss.elastic.co/t/invalid-value-for-monthofyear-and-nested-json-mapping/270019 "2021-04-13T14:02:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tommycahir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tommycahir/32/86987_2.png) [@tommycahir](https://discuss.elastic.co/u/tommycahir)\
**Post date:** [April 13, 2021, 2:02pm UTC](https://discuss.elastic.co/t/invalid-value-for-monthofyear-and-nested-json-mapping/270019/1 "2021-04-13T14:02:41Z")

</div>

Hi Folks, I am very new to Elastic Stack and am trying to insert a JSON list of JSON API responses to an index from a python script and am getting the error:

`elasticsearch.exceptions.RequestError: RequestError(400, 'mapper_parsing_exception', 'date_time_exception: Invalid value for MonthOfYear (valid values 1 - 12): 44')`

I have traced this back to the following field in the very nested JSON document:  
`{'L3&L4 ID': [{'L3': '1234-96E', 'L4': ['']}, {'L30': '1244-93E', 'L40': ['2322-44T', '4544-13Y']}], 'Name': 'Test 20-08 test module '}`

path to access that field for context  
`documents[0]['data'][0]['Levels'][0]`

It seems to be the value 2322-44T is being picked up as a date field type but I am lost as to how to map such a nested field to be string.

for clarity I have edited to add that I am using the below to add each json response from the list:  
`es.index(index='inv', id=str(doc_id), body=line)`

Any help would be greatly greatly appreciated, (reposted after masking some data values)  
Tommy

---

<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:** [May 11, 2021, 2:03pm UTC](https://discuss.elastic.co/t/invalid-value-for-monthofyear-and-nested-json-mapping/270019/2 "2021-05-11T14:03:35Z")

</div>

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