# Basic runtime fields to pull data from message field

**URL:** https://discuss.elastic.co/t/basic-runtime-fields-to-pull-data-from-message-field/355372
**Category:** Elasticsearch
**Tags:** runtime-fields
**Created:** [March 14, 2024, 8:01am UTC](https://discuss.elastic.co/t/basic-runtime-fields-to-pull-data-from-message-field/355372 "2024-03-14T08:01:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![randomnamegenerator](https://avatars.discourse-cdn.com/v4/letter/r/7ab992/32.png) [@randomnamegenerator](https://discuss.elastic.co/u/randomnamegenerator)
#### Post date: [March 14, 2024, 8:01am UTC](https://discuss.elastic.co/t/basic-runtime-fields-to-pull-data-from-message-field/355372/1 "2024-03-14T08:01:48Z")

</div>

Hello all,

I am trying to create a series of runtime fields to extract additional data fields from the message field. If it makes any difference this is a EFK stack running in K8s.

For example I want to create level field for our incoming logs (info,warn,error etc) and then aggregate each level

This is our log format

```auto
2024-03-13 07:36:59.195 [123] INFO blablabla: (unauthorized) 200 /api/blablatook 00:00:00.0001609

```

If anyone could recommend the correct expression that would be greatly appreciated.

I have read through the documentation but when I tried to reference the message.keyword field it appears as though its not found?

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

Thanks in advance

---

<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: [April 11, 2024, 8:02am UTC](https://discuss.elastic.co/t/basic-runtime-fields-to-pull-data-from-message-field/355372/2 "2024-04-11T08:02:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jughosta](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jughosta/32/107160_2.png) [@jughosta](https://discuss.elastic.co/u/jughosta)
#### Post date: [May 10, 2024, 9:36am UTC](https://discuss.elastic.co/t/basic-runtime-fields-to-pull-data-from-message-field/355372/3 "2024-05-10T09:36:48Z")

</div>

Hi @randomnamegenerator,

The expected format to access a field value inside a runtime field script is `doc["message.keyword"].value`[Manage data views | Kibana Guide [master] | Elastic](https://www.elastic.co/guide/en/kibana/master/managing-data-views.html#runtime-fields)

There are also other ways to parse logs. I would recommend to check these docs:

- [Parsing Logs with Logstash | Logstash Reference [8.13] | Elastic](https://www.elastic.co/guide/en/logstash/current/advanced-pipeline.html)
- [Filebeat quick start: installation and configuration | Filebeat Reference [8.13] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/8.13/filebeat-installation-configuration.html)
- [Parse and organize logs | Elastic Observability [8.13] | Elastic](https://www.elastic.co/guide/en/observability/current/logs-parse.html)
- [Example: Parse logs in the Common Log Format | Elasticsearch Guide [8.13] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/common-log-format-example.html)
