All Apps and Add-ons

Response filter pattern doesn't work for this case

rsokolova
Path Finder

Thanks in advance... I have an issues where the response filter is not working which is creating duplicates. I have a json response where there is need to check multiple values against the indexed data. Already checked and the regex is matching the raw data from the indexer and from the API call.

We need to check all the markets and the count by market.

Here is the regex passed in the Response Filter Pattern :

\"([A-Z][A-Z][A-Z]|[0-9]+)\"

Raw data:

{  "Orders" : [ {    "SourceApplication" : "CC",    "Market" : "GRP",    "OrderDate" : "2019-05-01T00:00:00.000-04:00",    "Count" : "25"  }, {    "SourceApplication" : "CC",    "Market" : "HOU",    "OrderDate" : "2019-05-01T00:00:00.000-04:00",    "Count" : "8"  }, {    "SourceApplication" : "CC",    "Market" : "SAA",    "OrderDate" : "2019-05-01T00:00:00.000-04:00",    "Count" : "14"  }, {    "SourceApplication" : "EDI",    "Market" : "LOU",    "OrderDate" : "2019-05-01T00:00:00.000-04:00",    "Count" : "1"  }, {    "SourceApplication" : "PA",    "Market" : "LOU",    "OrderDate" : "2019-05-01T00:00:00.000-04:00",    "Count" : "312"  } ]}

Data from API:

{
    "Orders": [
        {
            "SourceApplication": "CC",
            "Market": "GRP",
            "OrderDate": "2019-05-01T00:00:00.000-04:00",
            "Count": "25"
        },
        {
            "SourceApplication": "CC",
            "Market": "HOU",
            "OrderDate": "2019-05-01T00:00:00.000-04:00",
            "Count": "8"
        },
        {
            "SourceApplication": "CC",
            "Market": "SAA",
            "OrderDate": "2019-05-01T00:00:00.000-04:00",
            "Count": "14"
        },
        {
            "SourceApplication": "EDI",
            "Market": "LOU",
            "OrderDate": "2019-05-01T00:00:00.000-04:00",
            "Count": "1"
        },
        {
            "SourceApplication": "PA",
            "Market": "LOU",
            "OrderDate": "2019-05-01T00:00:00.000-04:00",
            "Count": "312"
        }
    ]
}
0 Karma

mhoogcarspel_sp
Splunk Employee
Splunk Employee

Response filter just filters out responses that don't match the regex, and you regex is fine for that.

Deduping at indextime against data already indexed isn't really possible, unless you can use some sort of checkpointing mechanism (a-la DBX rising column for example).

You might be able to use the token function of this addon for some sort of checkpointing.

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...