--- /dev/null
+Test output of XFF in unified2 alert logging.
+
+## Related Issues and Pull Requests
+- https://redmine.openinfosecfoundation.org/issues/2305
+- https://github.com/OISF/suricata/pull/3119
+
+## PCAP origin
+
+https://redmine.openinfosecfoundation.org/attachments/1424/xff-extradata.pcap
+
+### Request Headers
+
+GET /~sgtatham/putty/0.60/x86/pscp.exe HTTP/1.1
+User-Agent: Wget/1.17.1 (linux-gnu)
+Accept: */*
+Accept-Encoding: identity
+Host: the.earth.li
+Connection: Keep-Alive
+X-Forwarded-For: 10.1.23.250, 10.1.23.250
+
+### Response Headers
+
+HTTP/1.1 200 OK
+Date: Wed, 27 Sep 2017 18:58:30 GMT
+Server: Apache
+Last-Modified: Sun, 29 Apr 2007 13:02:37 GMT
+ETag: "48000-42f3ffb92f540"
+Accept-Ranges: bytes
+Content-Length: 294912
+Keep-Alive: timeout=5, max=100
+Connection: Keep-Alive
+Content-Type: application/x-msdos-program
--- /dev/null
+requires:
+ script:
+ - grep Unified2XFFTypeAlert src/alert-unified2-alert.c > /dev/null
+ # Require the idstools-u2json tool.
+ - which idstools-u2json > /dev/null 2>&1
+
+args:
+ - -k none
+
+pre-check: |
+ # Convert the unified2 to json.
+ idstools-u2json --output unified2.json unified2.alert 2> /dev/null
+
+checks:
+ - filter:
+ filename: unified2.json
+ count: 1
+ match:
+ type: event
+ - filter:
+ filename: unified2.json
+ count: 1
+ match:
+ type: extra-data
+ extra-data.extra-data-type: xff_ip4