# Help with handling errors sent by api

**URL:** <https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421>\
**Category:** Elasticsearch\
**Created:** [June 18, 2021, 9:33pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421 "2021-06-18T21:33:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agustin\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agustin_fernandez/32/77783_2.png) [@Agustin\_Fernandez](https://discuss.elastic.co/u/Agustin_Fernandez)\
**Post date:** [June 18, 2021, 9:33pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/1 "2021-06-18T21:33:10Z")

</div>

Hi! I am needing help with the rest api schema.

I want to make my program send the data to elastic but that it can be seen as is this example.

![image](https://us1.discourse-cdn.com/elastic/original/3X/b/b/bbb0ad4a8db4b6998e512e4106cf81805c3fe6aa.png)

The code that I had thought to use was this

```auto
{
    "mappings": {
        "properties": {
            "date": {
                "type": "date",
                "format": "yyyy-MM-d HH:mm:ss,SSSZ"
            },
            "info": {
                "properties": {
                    "app": {
                        "type": "text"
                    },
                    "type": {
                        "type": "text"
                    },
                    "runner": {
                        "type": "text"
                    },
                    "message": {
                        "type": "text"
                    }
                }
            },
            "error": {
                "properties": {
                    "app": {
                        "type": "text"
                    },
                    "type": {
                        "type": "text"
                    },
                    "runner": {
                        "type": "text"
                    },
                    "message": {
                        "type": "text"
                    }
                }
            },
            "debug": {
                "properties": {
                    "app": {
                        "type": "text"
                    },
                    "type": {
                        "type": "text"
                    },
                    "runner": {
                        "type": "text"
                    },
                    "message": {
                        "type": "text"
                    }
                }
            },
            "warning": {
                "properties": {
                    "app": {
                        "type": "text"
                    },
                    "type": {
                        "type": "text"
                    },
                    "runner": {
                        "type": "text"
                    },
                    "message": {
                        "type": "text"
                    }
                }
            },
            "fatal": {
                "properties": {
                    "app": {
                        "type": "text"
                    },
                    "type": {
                        "type": "text"
                    },
                    "runner": {
                        "type": "text"
                    },
                    "message": {
                        "type": "text"
                    }
                }
            }
        }
    }
}

```

But it didn't work out. I thought it was the parametry of the URL, but neither. I'm not understanding much of the api docs either.

If you can help me with this, I would be very grateful!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 21, 2021, 1:03am UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/2 "2021-06-21T01:03:58Z")

</div>

Welcome to our community! 😃

It's not really clear what you are trying to do, or what the issue is sorry. Can you elaborate a little more please?

---

<div class="post-metadata">

**Author:** ![Agustin\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agustin_fernandez/32/77783_2.png) [@Agustin\_Fernandez](https://discuss.elastic.co/u/Agustin_Fernandez)\
**Post date:** [June 22, 2021, 10:26am UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/4 "2021-06-22T10:26:36Z")

</div>

Thanks for responding, sorry I was not clear. What I want to try is for Kibana to tell me which app is giving me the Log report as shown in the capture I made with Nginx. How can I get this done? In the Json that happens, do you have to add something?

---

<div class="post-metadata">

**Author:** ![Agustin\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agustin_fernandez/32/77783_2.png) [@Agustin\_Fernandez](https://discuss.elastic.co/u/Agustin_Fernandez)\
**Post date:** [June 22, 2021, 11:10am UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/5 "2021-06-22T11:10:12Z")

</div>

the new json its this

```auto
{
    "mappings": {
        "properties": {
            "date": {
                "type": "date",
                "format": "yyyy-MM-d HH:mm:ss,SSSZ"
            },
            "app": {
                "type": "keyword"
            },
            "type": {
                "type": "keyword"
            },
            "runner": {
                "type": "keyword"
            },
            "message": {
                "type": "text"
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2021, 5:15am UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/6 "2021-06-24T05:15:43Z")

</div>

Ok, are you trying to create the graph in Kibana?  
If so then use a date histogram on the X axis, and then the `app` on the y and you should get it.

---

<div class="post-metadata">

**Author:** ![Agustin\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agustin_fernandez/32/77783_2.png) [@Agustin\_Fernandez](https://discuss.elastic.co/u/Agustin_Fernandez)\
**Post date:** [June 29, 2021, 9:43pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/7 "2021-06-29T21:43:53Z")

</div>

I understand, I'll have to see how that is. But the information as such, which is shown in this image that I shared, is configured with this tool, what are you mentioning?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 29, 2021, 10:02pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/8 "2021-06-29T22:02:28Z")

</div>

I am talking about using Kibana. If it's something else, then you'll need to be a little more forthcoming with information.

---

<div class="post-metadata">

**Author:** ![Agustin\_Fernandez](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/agustin_fernandez/32/77783_2.png) [@Agustin\_Fernandez](https://discuss.elastic.co/u/Agustin_Fernandez)\
**Post date:** [June 29, 2021, 10:42pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/9 "2021-06-29T22:42:00Z")

</div>

I think I was clear, but I will try again.

That I have to touch on the JSON that I POST to ELASTICSEARCH so that KIBANA detects from which APPLICATION SENT THE DATA.

Thanks.

---

<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:** [July 27, 2021, 10:42pm UTC](https://discuss.elastic.co/t/help-with-handling-errors-sent-by-api/276421/10 "2021-07-27T22:42:37Z")

</div>

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