# Field's name

**URL:** <https://discuss.elastic.co/t/fields-name/265313>\
**Category:** Kibana\
**Tags:** vega\
**Created:** [February 24, 2021, 10:00am UTC](https://discuss.elastic.co/t/fields-name/265313 "2021-02-24T10:00:43Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 24, 2021, 10:00am UTC](https://discuss.elastic.co/t/fields-name/265313/1 "2021-02-24T10:00:43Z")

</div>

Hi, i'm new with Kibana and Vega,  
I visualizated data that i entered manually and i noticed that when i enter a field name containing a dot (.) the visualization doesn't show up but when i remove the dot it works fine.  
The problem is that the data base that i'm currently using contains a file names with a dot  
What can i do in this case ?

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 24, 2021, 1:40pm UTC](https://discuss.elastic.co/t/fields-name/265313/2 "2021-02-24T13:40:37Z")

</div>

Could you please share your [Vega Spec](https://www.elastic.co/guide/en/kibana/current/vega.html#asking-for-help-with-a-vega-spec)?

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 24, 2021, 1:52pm UTC](https://discuss.elastic.co/t/fields-name/265313/3 "2021-02-24T13:52:00Z")

</div>

```auto
{
  "$schema": "https://vega.github.io/schema/vega-lite/v4.json",
  "data": {
    "name": "metricbeat",
    "values": [
      {
        "processname": "Java",
        "processstate": "running",
        "color": "green"
      },
      {
        "processname": "Apache",
        "processstate": "sleeping",
        "color": "red"
      },
      {
        "processname": "Node",
        "processstate": "unknown",
        "color": "yellow"
      },
      {
        "processname": "MySQL",
        "processstate": "sleeping",
        "color": "red"
      }
    ]
  },
  "scales": [
    {
      "name": "x",
      "domain": {
        "data": "metricebeat",
        "field": "processname"
      }
    }
  ],
  "mark": "circle",
  "config": {
    "circle": {
      "size": 1000
    },
    "range": {
      "category": {
        "scheme": "elastic"
      }
    },
    "mark": {
      "color": "#54B399"
    },
    "title": {
      "color": "#343741"
    },
    "style": {
      "guide-label": {
        "fill": "#69707d"
      },
      "guide-title": {
        "fill": "#343741"
      },
      "group-title": {
        "fill": "#343741"
      },
      "group-subtitle": {
        "fill": "#343741"
      }
    },
    "axis": {
      "tickColor": "#eef0f3",
      "domainColor": "#eef0f3",
      "gridColor": "#eef0f3"
    },
    "background": "transparent"
  },
  "encoding": {
    "column": {
      "field": "processname",
      "type": "nominal"
    },
    "color": {
      "field": "color",
      "type": "nominal",
      "scale": null
    }
  },
  "width": "container",
  "height": "container",
  "autosize": {
    "type": "fit",
    "contains": "padding"
  }
}

```

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 24, 2021, 11:15pm UTC](https://discuss.elastic.co/t/fields-name/265313/4 "2021-02-24T23:15:08Z")

</div>

Can you please post what data you are trying to add a period to?

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 25, 2021, 6:02am UTC](https://discuss.elastic.co/t/fields-name/265313/5 "2021-02-25T06:02:08Z")

</div>

I'm using data from metricbeat which contains fields "process.name" "process.state"

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 25, 2021, 11:59am UTC](https://discuss.elastic.co/t/fields-name/265313/6 "2021-02-25T11:59:33Z")

</div>

Use `['process.name']` to make that work when there are `.` in your field names.

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 25, 2021, 4:19pm UTC](https://discuss.elastic.co/t/fields-name/265313/7 "2021-02-25T16:19:14Z")

</div>

it gave me that error message:  
Found '[' where a key name was expected (check your syntax or use quotes if the key name includes {},: or whitespace) at line 6,8 \>\>\> {["process.nam ...

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 25, 2021, 4:31pm UTC](https://discuss.elastic.co/t/fields-name/265313/8 "2021-02-25T16:31:44Z")

</div>

Can you post the spec you used that generated this error?

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 25, 2021, 4:46pm UTC](https://discuss.elastic.co/t/fields-name/265313/9 "2021-02-25T16:46:57Z")

</div>

i don't know why but it showed me a spec  
anyway this is what i entered:  
{  
"$schema": "[https://vega.github.io/schema/vega-lite/v4.json](https://vega.github.io/schema/vega-lite/v4.json)",  
"data": {  
"name": "metricbeat",  
"values": [  
{["process.name"]: "Java", ["process.state"]: "running","color":"green"},  
{["process.name"]: "Apache", ["process.state"]: "sleeping","color":"red"},  
{["process.name"]: "Node", ["process.state"]: "unknown","color":"yellow"},  
{["process.name"]: "MySQL", ["process.state"]: "sleeping","color":"red"}  
]

},  
"scales":[  
{  
"name": "x",  
"domain":{"data":"metricebeat","field":["process.name"]},  
}  
],  
"mark" : "circle",  
"config":{  
"circle":{"size": 1000},  
}

"encoding": {  
"column": {"field": ["process.name"], "type": "nominal"},  
"color": {"field": "color", "type": "nominal","scale":null}

}

}

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 25, 2021, 5:12pm UTC](https://discuss.elastic.co/t/fields-name/265313/10 "2021-02-25T17:12:39Z")

</div>

Try this instead.

You data will come in as `process.name` so you can't change that in your data block. To make this easier just do a transform like I did below and rename that field to something without a `.` and then you can use that.

```auto
{
  "$schema": "https://vega.github.io/schema/vega-lite/v5.json",
  "description": "A simple bar chart with embedded data.",
  "data": {
    "values": [
      {"process.name": "A", "b": 28}, {"process.name": "B", "b": 55}, {"process.name": "C", "b": 43},
      {"process.name": "D", "b": 91}, {"process.name": "E", "b": 81}, {"process.name": "F", "b": 53},
      {"process.name": "G", "b": 19}, {"process.name": "H", "b": 87}, {"process.name": "I", "b": 52}
    ]
  },
    "transform": [
    {"calculate": "datum['process.name']", "as": "processName"}
  ],
  "mark": "bar",
  "encoding": {
    "x": {"field": "processName", "type": "nominal", "axis": {"labelAngle": 0}},
    "y": {"field": "b", "type": "quantitative"}
  }
}

```

---

<div class="post-metadata">

**Author:** ![NourBM](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nourbm/32/84451_2.png) [@NourBM](https://discuss.elastic.co/u/NourBM)\
**Post date:** [February 25, 2021, 11:47pm UTC](https://discuss.elastic.co/t/fields-name/265313/11 "2021-02-25T23:47:55Z")

</div>

That fixed the problem  
Thank you very much!

---

<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:** [March 25, 2021, 11:48pm UTC](https://discuss.elastic.co/t/fields-name/265313/12 "2021-03-25T23:48:32Z")

</div>

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