Help with handling errors sent by api

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

The code that I had thought to use was this

{
    "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!

Welcome to our community! :smiley:

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

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?

the new json its this

{
    "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"
            }
        }
    }
}

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.

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?

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

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.