# Accessing fields with special characters

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Fcookbook%2Faccessing_special_chars.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fcoralogix.com%2Fdocs%2Fdataprime%2Fcookbook%2Faccessing_special_chars.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

## Problem / Use case[​](#problem--use-case "Direct link to Problem / Use case")

You want to access fields with special characters such as periods (`.`), dashes (`-`), spaces (` `), or emojis, etc...

## Solution - `$d`[​](#solution---d "Direct link to solution---d")

You usually don’t need to use `$d` to access data fields in DataPrime. It’s the default namespace, so fields like `status_code` are automatically interpreted as `$d.status_code`.

But in these cases with special characters using `$d` is required.

### 1. Field names with dots[​](#1-field-names-with-dots "Direct link to 1. Field names with dots")

If your field name includes a dot (`.`), DataPrime treats it as a nested path unless you use bracket notation. This can lead to unexpected behavior.

For example:

```
{

  "kubernetes.namespace": "dev",

  "kubernetes": {

    "namespace": "prod"

  }

}
```

To access the field with a literal dot in the name (`kubernetes.namespace`), use:

```
$d['kubernetes.namespace']
```

**result**

```
"dev"
```

To access the nested field inside the `kubernetes` object (`kubernetes.namespace`), use:

```
$d['kubernetes']['namespace']
```

**result**

```
"prod"
```

### 2. Field names with spaces[​](#2-field-names-with-spaces "Direct link to 2. Field names with spaces")

Dot notation doesn’t support spaces. Use bracket notation:

```
choose $d['Total Salary']
```

### 3. Field names with emojis or non-ASCII characters[​](#3-field-names-with-emojis-or-non-ascii-characters "Direct link to 3. Field names with emojis or non-ASCII characters")

Fields with special characters require brackets:

```
create face from case_equals {

  $m.severity,

  DEBUG    -> '🧐',

  VERBOSE  -> '😶‍🌫️',

  INFO     -> '🙂',

  WARNING  -> '😬',

  ERROR    -> '😩',

  CRITICAL -> '💀',

  _          -> '🤷'

}

| countby face as $d['🙂'] into $d['# of times I made this face'] 
```

**Output:**

| "🙂" | "# of times I made this face" |
| ---- | ----------------------------- |
| 💀   | 17275                         |
| 😩   | 55821                         |
| 😬   | 13084                         |
| 😶‍🌫️   | 318376                        |
| 🙂   | 2958063                       |
| 🧐   | 3727783                       |
