This is our old Q&A Site. Please post any new questions and answers at


I’m having trouble extracting ipv6 fields (e.g. ipv6.src) using tshark and Lua.

There’s no problem with tshark because it successfully extracts ipv6.src etc. (e.g. tshark –r %1 -e ip.src -e ipv6.src -Tfields -E separator=, ). Rather, the problem arises when tshark is fed a Lua script (e.g. tshark -q -r %1 -X lua_script:LuaScript.lua)

The essence of the Lua script is shown below:

ip_src_extractor ="ip.src")

ipv6_src_extractor ="ipv6.src")
local tap =, tvb, ip)
    local ip_src_f = ip_src_extractor()

    local ipv6_src_f = ipv6_src_extractor()

    local foo_tbl = {
        [“ip”] = { [“src”] = ip_src_f, … },
        [“ipv6”] = { [“src”] = ipv6_src_f, … },
end --tap

For ipv6 packets, nothing gets written into foo_tbl.ipv6.src and its content remains nil. Other fields (are extracted successfully and no problem extracting ipv4 fields.

So, unless there’s another step required for ipv6 I’m led to believe the problem rests with the Lua API (?)

It appears that the link below is related (?):

There's no evidence of a bug being raised. If it is a real issue (not due to method) it seems a fairly big shortcoming.

Thanks and Regards,


asked 23 Sep '16, 00:15

KDR's gravatar image

accept rate: 0%

Be the first one to answer this question!
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 23 Sep '16, 00:15

question was seen: 1,272 times

last updated: 23 Sep '16, 00:15

p​o​w​e​r​e​d by O​S​Q​A