Skip to main content
Solved

Cribl Stream: Global variable cannot use if statement with event value

  • Nov 4, 2026 11:52 AM UTC
  • 4 replies
  • 3 views

This message originated from Cribl Community Slack.
Click here to view the original link.

Can I put an if statement inside a global variable that references a value in an event to use within a pipeline? For example: host.toLowerCase().includes('foo') ? 'index1' : 'index2'

Best answer by Jon Rust

no, you'd need to provide event-based data as arguments to the global variable
View original

4 replies

Jon Rust
Forum|alt.badge.img
  • Employee
  • Answer
  • Nov 4, 2026 11:52 AM UTC
no, you'd need to provide event-based data as arguments to the global variable

Jon Rust
Forum|alt.badge.img
  • Employee
  • Nov 4, 2026 11:52 AM UTC
make the GV an expression, and accept host as an argument

Jon Rust
Forum|alt.badge.img
  • Employee
  • Nov 4, 2026 11:52 AM UTC


Links for this message:
image.png

Jon Rust
Forum|alt.badge.img
  • Employee
  • Nov 4, 2026 11:52 AM UTC


Links for this message:
image.png