File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -104,5 +104,24 @@ public void IPv4PatternTest()
104104 Assert . Equal ( ipAddress , grokResult [ 0 ] . Value ) ;
105105 Assert . Equal ( comment , grokResult [ 1 ] . Value ) ;
106106 }
107+
108+ [ Theory ]
109+ [ InlineData ( "2001:0db8:85a3:0000:0000:8a2e:0370:7334" ) ]
110+ [ InlineData ( "2001:db8:85a3:0:0:8a2e:370:7334" ) ]
111+ [ InlineData ( "2001:db8:85a3::8a2e:370:7334" ) ]
112+ [ InlineData ( "::1" ) ] // Loopback
113+ [ InlineData ( "::" ) ] // Default route
114+ public void IPv6PatternTest ( string ipAddress )
115+ {
116+ const string comment = "Free as in Free Beer" ;
117+ string logs = $ "{ ipAddress } :{ comment } ";
118+ string grokPattern = "%{IPV6:IP}:%{GREEDYDATA:comment}" ;
119+ Grok act = new Grok ( grokPattern ) ;
120+
121+ GrokResult grokResult = act . Parse ( logs ) ;
122+
123+ Assert . Equal ( ipAddress , grokResult [ 0 ] . Value ) ;
124+ Assert . Equal ( comment , grokResult [ 1 ] . Value ) ;
125+ }
107126 }
108127}
You can’t perform that action at this time.
0 commit comments