# Filtering on metadata and on output key both are not working

**URL:** <https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109>\
**Category:** LangSmith Product Help\
**Created:** [March 9, 2026, 6:44pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109 "2026-03-09T18:44:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![hesamzkr](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/hesamzkr/32/278_2.png) [@hesamzkr](https://forum.langchain.com/u/hesamzkr)\
**Post date:** [March 9, 2026, 6:44pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/1 "2026-03-09T18:44:45Z")

</div>

I have this metadata on the trace

 ![image](https://canada1.discourse-cdn.com/flex007/uploads/langchain/original/2X/1/12d6831d657b65ecd5a2f14de7e9062f3b5afd67.png)

but when I search by this metadata key it finds zero traces or runs. also when I literally click on the value so the query is generated by langsmith is still doesn’t work.

queries:

`and(eq(metadata_key, “suggested_email_id”), eq(metadata_value, 137652))`  
`----`  
`and(eq(metadata_key, “suggested_email_id”), eq(metadata_value, 137652), eq(is_root, true))`

I have a similar issue when searching by output key, the output key is an object so the trace returns

```json
{
    "action": "generate_draft",
    "draft": {
        "subject": "x",
        "date": "2026-03-09T17:32:44.351Z",
        "body": "<html><body><p>hi</p></body></html>",
        "wordCount": 110,
        "sessionId": "d778d06b-fd38-41ec-b501-1da877bdfb11",
        "metadata": {
            "tone": "professional",
        },
        "id": 137652,
        "createdAt": "2026-03-09T17:32:44.416Z",
        "updatedAt": "2026-03-09T17:32:44.416Z"
    },
}

```

I have tried `and(eq(output_key, “draft.id”), eq(output_value, 137652), eq(is_root, true))`

and `and(eq(output_key, “draft”), like(output_value, “%137652%”), eq(is_root, true))`

---

<div class="post-metadata">

**Author:** ![keenborder786](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/keenborder786/32/1757_2.png) [@keenborder786](https://forum.langchain.com/u/keenborder786)\
**Post date:** [March 9, 2026, 6:57pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/2 "2026-03-09T18:57:40Z")

</div>

> [@hesamzkr](#):
>
> y this metadata key it finds

@hesamzkr Could you manually check once to see if a trace with the given metadata exists? This happened to me once, the trace was never sent to LangSmith, and I couldn’t find it when searching using a specific metadata attribute. I know it sounds simple, but I’ve encountered this issue before. Just curious if you’ve already tried locating it manually.

---

<div class="post-metadata">

**Author:** ![hesamzkr](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/hesamzkr/32/278_2.png) [@hesamzkr](https://forum.langchain.com/u/hesamzkr)\
**Post date:** [March 10, 2026, 5:46pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/3 "2026-03-10T17:46:04Z")

</div>

the screenshot at the top is from a trace’s metadata I clicked on the trace an in the metadata section it was showing the id so I believe it’s tracked. any other things to look out for?

---

<div class="post-metadata">

**Author:** ![keenborder786](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/keenborder786/32/1757_2.png) [@keenborder786](https://forum.langchain.com/u/keenborder786)\
**Post date:** [March 10, 2026, 8:25pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/4 "2026-03-10T20:25:31Z")

</div>

Nope, if you are able to see the traces associated with the given metadata, then you’re good. If it helps, you can mark the above response as the solution and close this thread.

---

<div class="post-metadata">

**Author:** ![hesamzkr](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/hesamzkr/32/278_2.png) [@hesamzkr](https://forum.langchain.com/u/hesamzkr)\
**Post date:** [March 17, 2026, 3:34pm UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/5 "2026-03-17T15:34:53Z")

</div>

Thank you but well but it’s not solved since I can see but the filtering doesn’t work in langsmith and it’s very difficult to be able to see traces of agents without the filtering working

---

<div class="post-metadata">

**Author:** ![keenborder786](https://yyz1.discourse-cdn.com/flex007/user_avatar/forum.langchain.com/keenborder786/32/1757_2.png) [@keenborder786](https://forum.langchain.com/u/keenborder786)\
**Post date:** [March 18, 2026, 3:35am UTC](https://forum.langchain.com/t/filtering-on-metadata-and-on-output-key-both-are-not-working/3109/6 "2026-03-18T03:35:32Z")

</div>

@hesamzkr Can I recommend that you do a isolated call in a new `LANGCHAIN_PROJECT` with the given metadata filters and see if filters are working as per your expectation in the new project?
