# Eland: How to access and filter nested fields in a DataFrame?

**URL:** <https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [December 22, 2021, 11:27am UTC](https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672 "2021-12-22T11:27:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Paddyns](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Paddyns](https://discuss.elastic.co/u/Paddyns)\
**Post date:** [December 22, 2021, 11:27am UTC](https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672/1 "2021-12-22T11:27:08Z")

</div>

Hi,

I'm trying to use the examples from the ELAND docs e.g. this filtering example from [github](https://github.com/elastic/eland)

df[(df.Carrier=="Kibana Airlines") & (df.AvgTicketPrice \> 900.0) & (df.Cancelled == True)].head()

But the fields I have all seem to have points in them like agent.hostname so the char '.' in the fields are giving me issues e.g.

df[(df.agent.hostname=="SERVER1")].head()  
results in  
AttributeError: 'DataFrame' object has no attribute 'agent'

Can I change the field names in the ELAND DataFrame without affecting them in ElasticStack or how could I deal with these unusual field names while not dumping all the data to a local Pandas Dataframe?

@sethmlarson call out

---

<div class="post-metadata">

**Author:** ![sethmlarson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sethmlarson/32/93342_2.png) [@sethmlarson](https://discuss.elastic.co/u/sethmlarson)\
**Post date:** [December 24, 2021, 2:36pm UTC](https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672/2 "2021-12-24T14:36:45Z")

</div>

Hello! Looks like your fields may have dots in the names? (ie `agent.hostname`) Currently Eland doesn't support nested fields being accessed this way, could you open a feature request on GitHub for this?

Instead you should access your fields like so:

```python
df[df["agent.hostname"] == "SERVER1"].head()

```

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Paddyns](https://avatars.discourse-cdn.com/v4/letter/p/9de053/32.png) [@Paddyns](https://discuss.elastic.co/u/Paddyns)\
**Post date:** [January 4, 2022, 12:10pm UTC](https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672/3 "2022-01-04T12:10:20Z")

</div>

Thank you @sethmlarson - this allowed me pull back the data. I'll submit a feature request on Github  
Funny thing when I do use your query method it's shows as CAPITALs in the output while I must use lowercase in the query statement like below - this had me stuck for a while.

```auto
df[df["agent.hostname"] == "server1"].head()

```

---

<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:** [February 1, 2022, 12:10pm UTC](https://discuss.elastic.co/t/eland-how-to-access-and-filter-nested-fields-in-a-dataframe/292672/4 "2022-02-01T12:10:25Z")

</div>

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