# Create fields in kibana using log4j2

**URL:** https://discuss.elastic.co/t/create-fields-in-kibana-using-log4j2/375954
**Category:** Kibana
**Created:** [March 14, 2025, 8:24pm UTC](https://discuss.elastic.co/t/create-fields-in-kibana-using-log4j2/375954 "2025-03-14T20:24:14Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![mathias21](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@mathias21](https://discuss.elastic.co/u/mathias21)
#### Post date: [March 14, 2025, 8:24pm UTC](https://discuss.elastic.co/t/create-fields-in-kibana-using-log4j2/375954/1 "2025-03-14T20:24:15Z")

</div>

Hi everyone, I'm new to Kibana and need your help. How can I display the information written in logger.info in Kibana columns in my code?

For example: I want to create a field in Kibana called "persona" and store the "clientkey" data that appears in my standalone console. The same applies to another column I want to create within the "body" column. I want to create a column in Kibana called "documento" and store the "NroDocumento" value there.

This is how I write the information to my logger.info in my java code:

```auto
 logger.info("**IN: [cliekey={}]** [headers={}] [url={}] **[body={}]**", **head.getCliekey()**, head, url, **input** )

```

And this is how it prints in my Wildfly standalone console:

```auto
15:37:39,132 INFO [stdout] (default task-1) INFO [2025-03-14 15:37:39,130] [default task-1] (postCall [py.com.konecta.bor.ejb.RestCaller:80]) - **IN: [cliekey=null]** [url=http://localhost:8080/login] **[body={"NroDocumento":"0001001", ( ?░ ?? ?░),"Aplicacion":"WEBRIO","Ip":"127.0.0.1"}]**

```

and this is mi log4j2 configuration:

```auto
<property name="pattern">%-5p [%d] [%t] (%M [%C:%L]) - %replace{%m}{password=${regex}|Password=${regex}|"Password":${regex}|"password":${regex}|&lt;Password&gt;${regex}&lt;/Password&gt;|"Extracto":${regex}|"imagenDorsal":${regex}}{ ( ͡° ͜ʖ ͡°)}%n</property>
 <property name="pattern_timing">%-5p;%d;%t;%C.%M;%m%n</property>

```

and this is my logstash configuration:

```auto
input {
  file{
    type => "syslog"
    path => "C:/Users/Mathias/Documents/trabajo/servidores/wildfly-19.0/standalone/log/banca-online-rio/banca-online.log"
  }
}

filter {
  grok {
    match => {
      "message" => ".*cliekey=%{DATA:persona}.*"
    }
  }
}

output {
  elasticsearch {
    hosts => ["http://localhost:9200"]
    index => "pruebariolog"
    #user => "elastic"
    #password => "changeme"
  }
   stdout { codec => rubydebug }
}

```

In short: all the information currently appears in the @message field in Kibana, and what I want to achieve is to display certain information that appears in @message in individual fields in Kibana without using mdc or thread context.
