# How to print the values or grok expression and the line it is working on and file name and path

**URL:** <https://discuss.elastic.co/t/how-to-print-the-values-or-grok-expression-and-the-line-it-is-working-on-and-file-name-and-path/261385>\
**Category:** Logstash\
**Created:** [January 18, 2021, 6:49am UTC](https://discuss.elastic.co/t/how-to-print-the-values-or-grok-expression-and-the-line-it-is-working-on-and-file-name-and-path/261385 "2021-01-18T06:49:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![umen](https://avatars.discourse-cdn.com/v4/letter/u/ec9cab/32.png) [@umen](https://discuss.elastic.co/u/umen)\
**Post date:** [January 18, 2021, 6:49am UTC](https://discuss.elastic.co/t/how-to-print-the-values-or-grok-expression-and-the-line-it-is-working-on-and-file-name-and-path/261385/1 "2021-01-18T06:49:39Z")

</div>

i try to find how to print to log the name of the log file and the line the grok expretion is working on right now .

```auto
here the logstash config : 
input {
      s3 {
        "access_key_id" => "xxxx"
        "secret_access_key" => "xxxx"
        "bucket" => "perso-logstash-logs"
        "additional_settings" => {
        "force_path_style" => true
        "follow_redirects" => false
        }
        
      }
    }
    filter {
    
    grok {
        match => {
            "path" => "xxx-logstash-logs/(?<version>[^/]+)/(?<projname>[^/]+)/(?<myId>[^/]+)/" 
        }
    }
    

    
    }
    output {
      stdout { codec => rubydebug }
      elasticsearch {
        index => "%{version}-%{projname}-%{myId}-%{+YYYY.MM.dd}"
        hosts => ["http://xxxx.svc:9200"]
        user => "elastic"
        password => "xxxxxx"
        codec => "json"
      }
    }

```

How can i see in logs which line the grok is processing right now and  
what is the name of the file name and its full path, basically i like to know if the regexp  
capture the file .  
also how can i print the version, projname, myId group values ?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 15, 2021, 6:50am UTC](https://discuss.elastic.co/t/how-to-print-the-values-or-grok-expression-and-the-line-it-is-working-on-and-file-name-and-path/261385/2 "2021-02-15T06:50:00Z")

</div>

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