marotaal  
                
                  
                    January 22, 2024,  3:11pm
                   
                  1 
               
             
            
              Hola
Estoy generando un laboratorio para la recogida de logs (Apache, Sophos,.....)
Si tengo dos ficheros de apache (access y error) como especifico que cada fichero utilice su pipeline.
Configuracion del laboratorio
a)Esquema
b)Configuracion pipelines
filebeat setup --pipelines --modules apache
filebeat-7.17.15-apache-access-pipeline
Configuración filebeat.yml
> filebeat:
>   config:
>     modules:
>       path: /etc/filebeat/modules.d/*.yml
>       reload:
>         enabled: false
>   inputs:
>   - enabled: false
>     id: my-filestream-id
>     paths: null
>     type: filestream
>   - enabled: true
>     id: apache-filebeat
>     paths:
>     - /root/access_test.log
>     type: filestream
> output:
>   elasticsearch:
>     hosts:
>     - localhost:9200
> path:
>   config: /etc/filebeat
>   data: /var/lib/filebeat
>   home: /usr/share/filebeat
>   logs: /var/log/filebeat
> processors:
> - add_host_metadata:
>     when:
>       not:
>         contains:
>           tags: forwarded
> - add_cloud_metadata: null
> - add_docker_metadata: null
> - add_kubernetes_metadata: null
Configuracion por defecto carga los logs, no ejecutar pipeline
Configuracion especifico el index,error
Exiting: setup.template.name and setup.template.pattern have to be set if index name is modified
Funciona correctamente
Gracias
             
            
              1 Like 
            
            
           
          
            
              
                strawgate  
              
                  
                    January 23, 2024,  1:45am
                   
                  2 
               
             
            
              Hola, puedo leer español pero solo escribir en inglés, espero que esto sea útil.
Invocar el comandosudo filebeat modules enable apache
That command will rename modules.d/apache.yml.disabled to modules.d/apache.yml
Editar el archivo modules.d/apache.yml
- module: apache
  access:
    enabled: true
    var.paths: ["/root/access_test.log*"]
  error:
    enabled: true
    var.paths: ["/root/error_test.log*"]
Editar el archivo Filebeat.yml
 filebeat:
   config:
     modules:
       path: /etc/filebeat/modules.d/*.yml
       reload:
         enabled: false
 output:
   elasticsearch:
     hosts:
     - localhost:9200
 path:
   config: /etc/filebeat
   data: /var/lib/filebeat
   home: /usr/share/filebeat
   logs: /var/log/filebeat
 processors:
 - add_host_metadata:
     when:
       not:
         contains:
           tags: forwarded
 - add_cloud_metadata: null
 - add_docker_metadata: null
 - add_kubernetes_metadata: null
 
            
              
            
           
          
            
              
                marotaal  
              
                  
                    January 23, 2024,  8:33am
                   
                  3 
               
             
            
              Hola.
He probado la configuración que indicas, pero no se aplican las pipelines.
Donde podría ver información de lo que esta ocurriendo , he revisado el fichero /var/log/filebeat/filebeat y no muestra información?
             
            
              
            
           
          
            
              
                strawgate  
              
                  
                    January 23, 2024,  4:30pm
                   
                  4 
               
             
            
              
 marotaal:
 
Hola.
He probado la configuración que indicas, pero no se aplican las pipelines.
Donde podría ver información de lo que esta ocurriendo , he revisado el fichero /var/log/filebeat/filebeat y no muestra información?
 
 
The pipelines are applied automatically by the module in the background and executed when the document hits elasticsearch (ingest pipelines run in elasticsearch) as long as you do not override the pipeline settings.
Machine Translation:
             
            
              
            
           
          
            
              
                strawgate  
              
                  
                    January 23, 2024,  9:24pm
                   
                  5 
               
             
            
              We can also have filebeat output to the console which would help me troubleshoot this issue with you.
Machine Translation: También podemos tener salida de filebeat a la consola, lo que me ayudaría a solucionar este problema con usted.
 output.console:
   pretty: true
Editar el archivo Filebeat.yml
 filebeat:
   config:
     modules:
       path: /etc/filebeat/modules.d/*.yml
       reload:
         enabled: false
 output.console:
   pretty: true
 path:
   config: /etc/filebeat
   data: /var/lib/filebeat
   home: /usr/share/filebeat
   logs: /var/log/filebeat
 processors:
 - add_host_metadata:
     when:
       not:
         contains:
           tags: forwarded
 - add_cloud_metadata: null
 - add_docker_metadata: null
 - add_kubernetes_metadata: null
Can you invoke the command and share the result with me? Specifically whatever is logged to the console?
Machine Translation: ¿Puedes invocar el comando y compartir el resultado conmigo? ¿Específicamente lo que está registrado en la consola?
             
            
              
            
           
          
            
              
                system  
              
                  
                    February 20, 2024,  9:24pm
                   
                  6 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.