Skip to main content
Question

Testing 2 different index mapping in Elastic

  • March 11, 2025
  • 23 replies
  • 6 views

I'm trying to test 2 different index mapping in Elastic. How do I send output to these 2 indexes? Doesn't seem like I can do with the "Output" when defining routes (no quick connect).

23 replies

David Maislin

Index or data stream: Enter a JavaScript expression that evaluates to the name of the Elastic data stream or Elastic index where you want events to go. The expression is evaluated for each event; can evaluate to a constant value; and must be enclosed in quotes or backticks. An event's `__index` field can overwrite the index or data stream name.


David Maislin

David Maislin

Is that what you are doing?


  • Author
  • Known Participant
  • March 11, 2025

I want to send to a data stream and a time series data stream.


David Maislin

Ah


  • Author
  • Known Participant
  • March 11, 2025

duplicate the data on the output


David Maislin

Clone function first and modify the clone event to a different index, then use an Output Router based on __index to go to two different destinations.


David Maislin

  • Author
  • Known Participant
  • March 11, 2025

Let me try this. Sounds promising!


  • Author
  • Known Participant
  • March 11, 2025

Excellent. This works!


David Maislin

Noice!


David Maislin

Output router is amazing!


  • Author
  • Known Participant
  • March 11, 2025

I configured 2 output index but I'm getting 3 documents for each interval


  • Author
  • Known Participant
  • March 11, 2025

0


  • Author
  • Known Participant
  • March 11, 2025

Does it need to be final on both?


  • Author
  • Known Participant
  • March 11, 2025

The duplicated documents is on the bottom one.


David Maislin

No, you have it correct


David Maislin

You can also use the filters


  • Author
  • Known Participant
  • March 11, 2025

I believe it worked fine at first, then it started writing 3 times instead of 2.


David Maislin

true is everything to both places


David Maislin

index1 == xyz goes to dest 1 FINALindex2 == abc goes to dest 2 FINAL


  • Author
  • Known Participant
  • March 11, 2025

Do I need to change something?


David Maislin

I DM'd you