# Grok parsing and skipping lines

**URL:** https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864
**Category:** Logstash
**Created:** [September 22, 2021, 12:25pm UTC](https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864 "2021-09-22T12:25:42Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Mira\_9](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Mira\_9](https://discuss.elastic.co/u/Mira_9)
#### Post date: [September 22, 2021, 12:25pm UTC](https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864/1 "2021-09-22T12:25:42Z")

</div>

Hey! i have to parse the output of a command linux,extract specific fields and skip some lines.I'm trying but its not working.

```auto
SSID: "#SOMB-875-LY5C"
Mode: Managed RSSI: 1 dBm SNR: 0 dB noise: -89 dBm Channel: 120
BSSID: 2C:7M:68:NC:12:Z1 Capability: ESS 
Supported Rates: [1(N) 8 2(E) 48 49(C) 65 57 25]
VHT Capable:
        Chanspec: 5GHz channel 106 80MHz (0xe010b)
        Primary channel: 100

```

i want to extract the _ **"noise" ,"BSSID" .** _ plus _ **the two last lines** _

Any idea please?  
this is my trial

```auto
%{WORD:Mode}\s+%{NOTSPACE:RSSI}\s+%{NUMBER:Value:INT}\s+%{WORD:DB}\s+%{NOTSPACE:SNR}\s+%{NUMBER:VALUE}\s+%{WORD:DB2}\s+%{NOTSPACE:noise}\s+%{NUMBER:ValueNeg:INT}\s+%{WORD:DB3}\s+%{NOTSPACE:chan}\s+%{NUMBER:valuechan:INT}\n

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [September 22, 2021, 11:03pm UTC](https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864/2 "2021-09-22T23:03:28Z")

</div>

I would try an approach like [this](https://discuss.elastic.co/t/issue-parsing-db2diag-log-using-grok-filter/281957/2).

---

<div class="post-metadata">

### Author: ![Mira\_9](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@Mira\_9](https://discuss.elastic.co/u/Mira_9)
#### Post date: [September 23, 2021, 8:38am UTC](https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864/3 "2021-09-23T08:38:42Z")

</div>

unfortunately it's not working. the Grok Debugger is indicating "no matches"

```auto
"SSID : %{NOTSPACE:ssid}",
                "noise : %{NOTSPACE:noise}",
                "BSSID: %{NOTSPACE:bssid}",
                "Chanspec : %{NOTSPACE:Chanspec}",
                "Primary channel : %{GREEDYDATA:primary}

```

---

<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: [October 21, 2021, 8:39am UTC](https://discuss.elastic.co/t/grok-parsing-and-skipping-lines/284864/4 "2021-10-21T08:39:22Z")

</div>

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