Versioner sammenlignet

Nøgle

  • Linjen blev tilføjet.
  • Denne linje blev fjernet.
  • Formatering blev ændret.

...

Scripted fields are found in the Management section:

So, my field in the fist successfull attempt looks like:

Kodeblok
if (doc['SRC.keyword'].value == "10.0.0.185") {
     return "Christopher"
    }

 

But, the docs also state: "Java’s control flow statements are supported, with the exception of the switch statement.", so we cant use the switch, hence I will base it on if's:

Kodeblok
if (doc['SRC.keyword'].value == "10.0.0.104") {
     return "Toke"
    }
if (doc['SRC.keyword'].value == "10.0.0.185") {
     return "Christopher"
    }
...
...
...
...
if (doc['SRC.keyword'].value == "10.0.0.196") {
     return "Toke"
    }