Set index according to input

Hi, I'm trying to set the index according to the id of sqs input. Tried something like this but without success.

   input {
          sqs {
            id => "product
            queue => "live-product
            add_field => {
              origin => "product"
            }
          }
          sqs {
            id => "customer"
            queue => "live-customer"
            add_field => {
              origin => "customer"
            }
          }
        }
        output {
          elasticsearch {
            hosts => ["http://some_host:9200"]
            index => "%{message.origin}"
          }
          stdout { codec => rubydebug }
        }

Do you have any light about this?
Thanks.

That should just be

index => "%{origin}"

No parsing is executed, the index is created literally with %{origin} name

Do you see a field called origin on the events in the %{origin} index?

Sorry, I was adding a field with _origin, for another test.
Now it's working perfectly!

Thanks.

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