# Writing to two data streams

**URL:** <https://discuss.elastic.co/t/writing-to-two-data-streams/315493>\
**Category:** Elasticsearch\
**Created:** [September 29, 2022, 5:57pm UTC](https://discuss.elastic.co/t/writing-to-two-data-streams/315493 "2022-09-29T17:57:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulrik](https://avatars.discourse-cdn.com/v4/letter/u/f07891/32.png) [@Ulrik](https://discuss.elastic.co/u/Ulrik)\
**Post date:** [September 29, 2022, 5:57pm UTC](https://discuss.elastic.co/t/writing-to-two-data-streams/315493/1 "2022-09-29T17:57:54Z")

</div>

We are collecting logs and uses fleet with agents.  
I would like to configure some agents to write data in two data streams instead of just one.  
As far as I can understand you specify the data stream to use in the integration config in the dataset name field but I think you can only specify one data set there.

The use case is to have a separate data streams for some application logs but also have the same data in a data stream used for security logging, I could then have different permissions on the data streams.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 4, 2022, 5:19am UTC](https://discuss.elastic.co/t/writing-to-two-data-streams/315493/2 "2022-10-04T05:19:02Z")

</div>

Your two options are;

1. Use field and document level security
2. Use an ingest pipeline to split the data into different indices, then secure them from there

---

<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:** [November 1, 2022, 5:19am UTC](https://discuss.elastic.co/t/writing-to-two-data-streams/315493/3 "2022-11-01T05:19:22Z")

</div>

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