# Compare/Merge 2 type of dataset

**URL:** <https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624>\
**Category:** Logstash\
**Created:** [August 27, 2021, 4:43am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624 "2021-08-27T04:43:44Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peter\_Ch](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@Peter\_Ch](https://discuss.elastic.co/u/Peter_Ch)\
**Post date:** [August 27, 2021, 4:43am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/1 "2021-08-27T04:43:44Z")

</div>

Dear All,

I user winlogbeat to collet my window log which include username. And I have a csv file which contain the username and user department. May I know is it possible to compare those datasets username field, if those username are same, add department to the winlogbeat log?

Thanks

Best Regards  
Peter

---

<div class="post-metadata">

**Author:** ![leandrojmp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/leandrojmp/32/107231_2.png) [@leandrojmp](https://discuss.elastic.co/u/leandrojmp)\
**Post date:** [August 27, 2021, 4:50am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/2 "2021-08-27T04:50:11Z")

</div>

You can use the [translate](https://www.elastic.co/guide/en/logstash/current/plugins-filters-translate.html#_description_155) filter in logstash to that.

---

<div class="post-metadata">

**Author:** ![Peter\_Ch](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@Peter\_Ch](https://discuss.elastic.co/u/Peter_Ch)\
**Post date:** [August 30, 2021, 7:09am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/3 "2021-08-30T07:09:49Z")

</div>

I tried but fail. I use below code for window log but no result return even no department field show up. However, i use csv for testing is success. they are same code. Any idea?

```auto
filter {
  translate {
    field => ["winlog.user.name"]
    destination => ["department"]
    fallback => "not_found"
	dictionary_path => "D:\elastic\logstash-7.14.0\config\test.yaml"
  }
    }

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [August 30, 2021, 11:39am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/4 "2021-08-30T11:39:47Z")

</div>

> [@Peter\_Ch](#):
>
> `field => ["winlog.user.name"]`

In logstash, that would be a field with two dots in its name, not a field within a field within a field. Use

```
field => "[winlog][user][name]"

```

---

<div class="post-metadata">

**Author:** ![Peter\_Ch](https://avatars.discourse-cdn.com/v4/letter/p/e19adc/32.png) [@Peter\_Ch](https://discuss.elastic.co/u/Peter_Ch)\
**Post date:** [September 7, 2021, 8:22am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/5 "2021-09-07T08:22:37Z")

</div>

Dear Badger,

It works!! thanks!

---

<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:** [October 5, 2021, 8:23am UTC](https://discuss.elastic.co/t/compare-merge-2-type-of-dataset/282624/6 "2021-10-05T08:23:11Z")

</div>

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