log4stash icon indicating copy to clipboard operation
log4stash copied to clipboard

IndexOperationParams from example is not working

Open dariusdev opened this issue 2 years ago • 1 comments

When i try to use this in my configuration:

<IndexOperationParams>
  <Parameter>
	  <Key>_id</Key>
	  <Value>%{IdSource}</Value>
  </Parameter>
  <Parameter>
	  <Key>key</Key>
	  <Value>value</Value>
  </Parameter>
</IndexOperationParams>

I am receiving error:
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [Parameter]

Should i use? :

<IndexOperationParams>
  <OrSetParameter>
	  <Key>_id</Key>
	  <Value>%{IdSource}</Value>
  </OrSetParameter>
  <OrSetParameter>
	  <Key>key</Key>
	  <Value>value</Value>
  </OrSetParameter>
</IndexOperationParams>

For me it is not clear what IndexOperationParams is doing at all. Can someone help with better explanation or examples what this property is doing and how it could be used?

dariusdev avatar Mar 21 '22 13:03 dariusdev

Weird that it is not working, I will have to check.

In the meantime - IndexOperationParams is there for adding custom properties to your log message.
Similar to mutate-add_field in logstash - https://www.elastic.co/guide/en/logstash/current/plugins-filters-mutate.html#plugins-filters-mutate-add_field

Have you tried with OrSetParameter and it worked? or is it just a guess? I don't see a reason why it should work instead of Parameter

urielha avatar Apr 10 '22 10:04 urielha