Uploaded image for project: 'Metron (Retired)'
  1. Metron (Retired)
  2. METRON-1533

Create KAFKA_FIND Stellar Function

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Done
    • Minor
    • Resolution: Done
    • None
    • 0.6.0
    • None

    Description

      When creating enrichments, I often find that I want to validate that the enrichment I just created was successful on the live, incoming stream of telemetry. My workflow looks something like this.

      1. Create and test the enrichment that I want to create.

      [Stellar]>>> ip_src_addr := "72.34.49.86"
      72.34.49.86
      [Stellar]>>> geo := GEO_GET(ip_src_addr)
      {country=US, dmaCode=803, city=Los Angeles, postalCode=90014, latitude=34.0438, location_point=34.0438,-118.2512, locID=5368361, longitude=-118.2512}
      

      2. That looks good to me. Now let's add that to my Bro telemetry.

      [Stellar]>>> conf := SHELL_EDIT(conf)
      {
        "enrichment" : {
          "fieldMap": {
            "stellar": {
              "config": [
                 "geo := GEO_GET(ip_src_addr)"
              ]
            }
          }
        },
        "threatIntel": {
        }
      }
      [Stellar]>>> CONFIG_PUT("ENRICHMENTS", e, "bro")
      

       
      3.  It looks like that worked, but did that really work?

      At this point, I would run KAFKA_GET as many times as it takes to retrieve a Bro message. You would just have to get lucky and hope that the enrichment worked and secondly that you would pull down a Bro message (as opposed to a different sensor).

       

      I would rather have a function that lets me only pull back the messages that I care about. In this case I could either retrieve only Bro messages.

      KAFKA_FIND('indexing', m -> MAP_GET('source.type', m) == 'bro')
      

      Or I could look for messages that contain geolocation data.

      KAFKA_FIND('indexing', m -> MAP_EXISTS('geo.city', m))
      

      Attachments

        Issue Links

          Activity

            People

              nickwallen Nick Allen
              nickwallen Nick Allen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: