You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@metron.apache.org by Ali Nazemian <al...@gmail.com> on 2018/02/09 03:55:40 UTC
Stellar post-parsing transformation conditional statement
Hi All,
I was wondering how we can address if statement in the config section to
have a different mapping in certain conditions. The following syntax is not
acceptable.
{
"parserClassName": "org.apache.metron.parsers.asa.BasicAsaParser",
"filterClassName": null,
"sensorTopic": "test-asa",
"writerClassName": null,
"errorWriterClassName": null,
"invalidWriterClassName": null,
"parserConfig": {},
"fieldTransformations": [
{
"input": [],
"output": [
"x",
"y",
"z",
],
"transformation": "STELLAR",
"config": {
IF "ip_src_port" == 39296 THEN
"x": "something",
"y": "something else"
ELSE
"y": "something",
"z": "something else"
}
}
]
}
Regards,
Ali
Re: Stellar post-parsing transformation conditional statement
Posted by Ali Nazemian <al...@gmail.com>.
Any example would be appreciated.
On 9 Feb. 2018 15:37, "Ali Nazemian" <al...@gmail.com> wrote:
> Match is not available in our version. What about MAP_GET? How can I use
> it for this matter? I couldn't understand what the solution is.
>
> On Fri, Feb 9, 2018 at 3:02 PM, Simon Elliston Ball <
> simon@simonellistonball.com> wrote:
>
>> You either want a MAP_GET in your IF or a match statement in there I
>> expect. See the match statement at https://github.com/apache/m
>> etron/blob/master/metron-stellar/stellar-common/README.md under core
>> functions (it’s relatively new)
>>
>> Simon
>>
>> Sent from my iPhone
>>
>> On 9 Feb 2018, at 03:55, Ali Nazemian <al...@gmail.com> wrote:
>>
>> Hi All,
>>
>> I was wondering how we can address if statement in the config section to
>> have a different mapping in certain conditions. The following syntax is not
>> acceptable.
>>
>> {
>> "parserClassName": "org.apache.metron.parsers.asa.BasicAsaParser",
>> "filterClassName": null,
>> "sensorTopic": "test-asa",
>> "writerClassName": null,
>> "errorWriterClassName": null,
>> "invalidWriterClassName": null,
>> "parserConfig": {},
>> "fieldTransformations": [
>> {
>> "input": [],
>> "output": [
>> "x",
>> "y",
>> "z",
>> ],
>> "transformation": "STELLAR",
>> "config": {
>> IF "ip_src_port" == 39296 THEN
>> "x": "something",
>> "y": "something else"
>>
>> ELSE
>> "y": "something",
>> "z": "something else"
>> }
>> }
>> ]
>> }
>>
>> Regards,
>> Ali
>>
>>
>
>
> --
> A.Nazemian
>
Re: Stellar post-parsing transformation conditional statement
Posted by Ali Nazemian <al...@gmail.com>.
Match is not available in our version. What about MAP_GET? How can I use it
for this matter? I couldn't understand what the solution is.
On Fri, Feb 9, 2018 at 3:02 PM, Simon Elliston Ball <
simon@simonellistonball.com> wrote:
> You either want a MAP_GET in your IF or a match statement in there I
> expect. See the match statement at https://github.com/apache/
> metron/blob/master/metron-stellar/stellar-common/README.md under core
> functions (it’s relatively new)
>
> Simon
>
> Sent from my iPhone
>
> On 9 Feb 2018, at 03:55, Ali Nazemian <al...@gmail.com> wrote:
>
> Hi All,
>
> I was wondering how we can address if statement in the config section to
> have a different mapping in certain conditions. The following syntax is not
> acceptable.
>
> {
> "parserClassName": "org.apache.metron.parsers.asa.BasicAsaParser",
> "filterClassName": null,
> "sensorTopic": "test-asa",
> "writerClassName": null,
> "errorWriterClassName": null,
> "invalidWriterClassName": null,
> "parserConfig": {},
> "fieldTransformations": [
> {
> "input": [],
> "output": [
> "x",
> "y",
> "z",
> ],
> "transformation": "STELLAR",
> "config": {
> IF "ip_src_port" == 39296 THEN
> "x": "something",
> "y": "something else"
>
> ELSE
> "y": "something",
> "z": "something else"
> }
> }
> ]
> }
>
> Regards,
> Ali
>
>
--
A.Nazemian
Re: Stellar post-parsing transformation conditional statement
Posted by Simon Elliston Ball <si...@simonellistonball.com>.
You either want a MAP_GET in your IF or a match statement in there I expect. See the match statement at https://github.com/apache/metron/blob/master/metron-stellar/stellar-common/README.md under core functions (it’s relatively new)
Simon
Sent from my iPhone
> On 9 Feb 2018, at 03:55, Ali Nazemian <al...@gmail.com> wrote:
>
> Hi All,
>
> I was wondering how we can address if statement in the config section to have a different mapping in certain conditions. The following syntax is not acceptable.
>
> {
> "parserClassName": "org.apache.metron.parsers.asa.BasicAsaParser",
> "filterClassName": null,
> "sensorTopic": "test-asa",
> "writerClassName": null,
> "errorWriterClassName": null,
> "invalidWriterClassName": null,
> "parserConfig": {},
> "fieldTransformations": [
> {
> "input": [],
> "output": [
> "x",
> "y",
> "z",
> ],
> "transformation": "STELLAR",
> "config": {
> IF "ip_src_port" == 39296 THEN
> "x": "something",
> "y": "something else"
>
> ELSE
> "y": "something",
> "z": "something else"
> }
> }
> ]
> }
>
> Regards,
> Ali