Skip to content
Discussion options

You must be logged in to vote

Oh, I think I found the answer. I think using abort and drop_on_abort = true is the key like so:

[transforms.extract-entity-count]
inputs = ["parse_graph_node_logs"]
type = "remap"
drop_on_abort = true
source = """
final_fields = {}
final_fields.subgraph_id = .subgraph_id
final_fields.unix_timestamp = .unix_timestamp
final_fields.cluster_name = .cluster_name

# Extract the entity count from the message
regexed, err = parse_regex(.message, r'^.*entities: (?P<entity_count>\\d+),')
if err == null {
  final_fields.entity_count = parse_int!(regexed.entity_count)
  . |= final_fields
} else {
  # if we didn't extract an entity count from this message abort this pipeline (note `drop_on_abort = tr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by paymog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant