Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Tutorials
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • Integration Studio
      • System Architecture
      • DataMiner Releases & Updates
      • DataMiner Apps
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

Create Dynamic AND/OR filter

Solved272 views2 days agoORFilterElement repositoryRegistry
4
Gerwin van der Kamp [DevOps Enabler]2.91K 16th April 2025 4 Comments

I'm looking into building an adhoc datasource to provide some more insight into usage of our matrix crosspoints. since every crosspoint being made adds an information event i'm tempting to go through them with the repositoryRegistry however instead of fetching all information events on a wildcard and then filtering them i was wondering if i can already dynamicaly add them to an orfilter

Basically i want to add a bunch of

new ORFilterElement<Info>(
InfoExposers.ParameterName.Contains("search x" ),
InfoExposers.Value.Contains("Value x"),
InfoExposers.ElementID.Equal(elementId),
InfoExposers.SeverityID.Equal(severity)
);

into

var filter = new ANDFilterElement<Info>(
InfoExposers.TimeOfArrival.GreaterThan(start),
InfoExposers.TimeOfArrival.LessThan(end),
Dynamiclistof Filters
);

so i can pass them to the: CreateReadQuery(filter).Execute();

is this possible?

Gerwin van der Kamp [DevOps Enabler] Selected answer as best 2 days ago
Benjamin Hodžić [SLC] [DevOps Advocate] commented 18th April 2025

Hello Gerwin!

I haven't had such a use case myself, but I can confirm that code-wise this will compile as these classes are implemented from the same interface, IFilterElement

Here's a code snippet of some combinations you can try:
var orFilter1 = InfoExposers.AlarmID.Equal(7236128).OR(
InfoExposers.AlarmID.Equal(237473),
InfoExposers.AlarmID.Equal(95738));

var orFilter2 = InfoExposers.SeverityID.Equal(4).OR(
InfoExposers.SeverityID.Equal(0),
InfoExposers.SeverityID.Equal(5));

// Option 1: without inital filter
var filter1 = new ANDFilterElement<Info>(orFilter1, orFilter2);

// Option 2: with inital filter
var filter2 = InfoExposers.AlarmID.Equal(2).AND(orFilter1, orFilter2);

// Option 3: Mixed
var filter3 = new ANDFilterElement<Info>(InfoExposers.Comments.Contains("T").AND(orFilter1), orFilter2);

Marieke Goethals [SLC] [DevOps Catalyst] commented 25th April 2025

Hi Gerwin,
Was Benjamin's comment sufficient to answer your question, or would you still like more information?

Gerwin van der Kamp [DevOps Enabler] commented 25th April 2025

i've hadn't had time to look into it. It might be workable but i have to play around with it

Gerwin van der Kamp [DevOps Enabler] commented 29th April 2025

No this does not work since i can have an list of infoexposers raning from 1 to 30 or more. I think that for now i'm stuck to client side processing.

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
3
Xander Warszawski [SLC] [DevOps Advocate]171 Posted 2 days ago 1 Comment

Hi Gerwin,

If I understand your question correctly you want to:
- Filter on TimeOfArrival <= x and TimeOfArrival >= y
- Also filter on some exposers of information events
- The information event filters are constructed at runtime based on a different query/method/...

If this is indeed your question than I believe your answer would be about right, to give you a complete example I believe this should work:

var filters = new List<FilterElement<Info>>
{
InfoExposers.TimeOfArrival.GreaterThan(DateTime.UtcNow),
InfoExposers.TimeOfArrival.LessThan(DateTime.UtcNow),
};

for (var i = 0; i < 10; i++)
{
filters.Add(new ORFilterElement<Info>(
InfoExposers.ParameterName.Contains("..."),
InfoExposers.Value.Contains("..."),
InfoExposers.ElementID.Equal(1),
InfoExposers.SeverityID.Equal(1)
));
}

var filter = new ANDFilterElement<Info>(
filters.ToArray()
);

Please let me know if this answer helps you.

Gerwin van der Kamp [DevOps Enabler] Posted new comment 2 days ago
Gerwin van der Kamp [DevOps Enabler] commented 2 days ago

That is exactly what i was looking for 🙂

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

Web Applications exception in Cube due to invalid certificate 0 Answers | 0 Votes
Redundancy Groups and Alarming – Duplicate Alarms 0 Answers | 0 Votes
Correlation Engine: “Test rule” doesn’t result in a hit, despite functional rule 1 Answer | 3 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (109) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (152) low code app (166) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin