cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

EsmFilterGroup

Hi,

I'm doing a query search with the EsmFilterGroup. However, the correct results is not returning, I'm only getting the first filter, the logic "AND" is not being applied. Could someone kindly assist me with the flow.

 

   {
                            "type": "EsmFilterGroup",
                            "filters":  [{
                                "type": "EsmFieldFilter",
                                "field": {
                                "name": "From"},
                                "operator": "EQUALS",
                                "values": [{
                                    "type": "EsmBasicValue",
                                    "value": emailFrom
                                }]
                            }], 
                            "logic": "AND",
                            "filters":  [{
                                "type": "EsmFieldFilter",
                                "field": {
                                "name": "To"},
                                "operator": "EQUALS",
                                "values": [{
                                    "type": "EsmBasicValue",
                                    "value": emailTo
                                }]
                            }],  
    }

Thank you.

1 Reply
SantiagoEB
McAfee Employee
McAfee Employee
Report Inappropriate Content
Message 2 of 2

Re: EsmFilterGroup

Hi, I had to do a similar query through ESM API recently and found this message while looking for help.

I know I'm 2 years late, but just as a reference for anyone else looking for the same thing, the way of doing it is similar to the original code except that both filters should be in the same filters array.

It should look similar to this:

 

                {
                        "type": "EsmFilterGroup",
                        "filters":  [{
                            "type": "EsmFieldFilter",
                            "field": {
                            "name": "From"},
                            "operator": "EQUALS",
                            "values": [{
                                "type": "EsmBasicValue",
                                "value": "emailFrom"
                                }]
                            },
                            {
                            "type": "EsmFieldFilter",
                            "field": {
                            "name": "To"},
                            "operator": "EQUALS",
                            "values": [{
                                "type": "EsmBasicValue",
                                "value": "emailTo"
                                }]
                            }
                        ], 
                        "logic": "AND"
                }

 

You Deserve an Award
Don't forget, when your helpful posts earn a kudos or get accepted as a solution you can unlock perks and badges. Those aren't the only badges, either. How many can you collect? Click here to learn more.

Community Help Hub

    New to the forums or need help finding your way around the forums? There's a whole hub of community resources to help you.

  • Find Forum FAQs
  • Learn How to Earn Badges
  • Ask for Help
Go to Community Help

Join the Community

    Thousands of customers use the McAfee Community for peer-to-peer and expert product support. Enjoy these benefits with a free membership:

  • Get helpful solutions from McAfee experts.
  • Stay connected to product conversations that matter to you.
  • Participate in product groups led by McAfee employees.
Join the Community
Join the Community