Skip to content

Best practice to cut down op geoip lookup events #23193

Answered by driehuis
driehuis asked this question in Q&A
Discussion options

You must be logged in to vote

To answer my own question, the lookup can be silenced by writing it as:

  geoip:
    type: remap
    inputs:
      - parse_logs
    source: |-
      geoip, err = get_enrichment_table_record("geoip_table", { "ip": .source_ip })
      if err == null {
        .geoip = geoip
      }

If you want to record the error with the data, you can simple store the error:

  geoip:
    type: remap
    inputs:
      - parse_logs
    source: |-
      geoip, err = get_enrichment_table_record("geoip_table", { "ip": .source_ip })
      if err == null {
        .geoip = geoip
      } else {
        .error = err
      }

All of this is in the docs, but these need to be re-read recursively a lot to start to mak…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by driehuis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
transform: remap Anything `remap` transform related
1 participant