Concatenate log

hello,

I have a beats log, who are concatenate and special characters.
I wanted request one of this field but I supposed my request is blocked because a bad syntax.

{
          "user" => {
          "name" => "AD-WSUS$",
        "domain" => "BUBODEV",
            "id" => "S-1-5-18"
    },
          "host" => {
                 "mac" => [
            [0] "xxx"
        ],
                "name" => "AD-wsus.bubodev.local",
                  "os" => {
                "type" => "windows",
              "family" => "windows",
                "name" => "Windows Server 2019 Standard",
              "kernel" => "xxxx",
             "version" => "10.0",
               "build" => "1xxx",
            "platform" => "windows"
        },
            "hostname" => "AD-wsus",
        "architecture" => "x86_64",
                  "ip" => [
            [0] "xxxx",
            [1] "xxxx"
        ],
                  "id" => "xxxx"
    },``` 

my request look like :

`if [host.ip] {
        memcached {
            hosts => ["xxx:11211"]
            namespace => "misp-ip"
            get => { "%{[host.ip]}" => "[enrich][tmp]" }
`
with apache log it's work properly but in this case not.

What is your question?

I want correct syntax to request my field IP log

You do not have a [host.ip] field, in logstash that would be a field with a period in its name. You have a [host][ip] field which is an array, so you would reference the first item in it using [host][ip][0]

It still can't get the request even with that :


filter {
      grok {
        match => { "[host][ip]" => "%{IPV4:clientip}" }
      }
        mutate {
  remove_tag => ["beats_input_codec_plain_applied"]
         }
 if [clientip] {
        memcached {
                hosts => ["127.0.0.1:11211"]
                namespace => "misp-ip"
                get => {"%{[clientip]}" => "[enrich][tmp]" }
        }
        if [enrich][tmp] {
            ruby { path => "/etc/logstash/process_ioc.rb" }
            mutate { remove_field => [ "[enrich]" ] }
         }
   }
 }

I don't understand why it doesn't make request.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.