Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adapter documentation... request for wireshark adapter #42

Closed
lweiner-spirent opened this issue May 15, 2020 · 2 comments
Closed

Adapter documentation... request for wireshark adapter #42

lweiner-spirent opened this issue May 15, 2020 · 2 comments

Comments

@lweiner-spirent
Copy link

lweiner-spirent commented May 15, 2020

Do you have documentation for creating ripgrep-all adapters?

I would like to have a ripgrep adapter for wireshark files (.pcap, .pcapng, etc). A general purpose adapter would have to be highly configurable, but in my case, I generally convert to text using this command:
tshark -V -Y "(ngap || nas-5gs || s1ap || sip || diameter)" -r ${wireshark_file_name}

A general purpose adapter could just use tshark -V -r ${wireshark_file_name}.

An even more general purpose adapter could allow you to specify the following parameters:
RGA_USER_ADAPTER=${path_to_executable}
RGA_USER_ADAPTER_FLAGS=${flags}

As in ...
RGA_USER_ADAPTER=/usr/bin/tshark
RGA_USER_ADAPTER_FLAGS="-V -r {}"
or ...
RGA_USER_ADAPTER_FLAGS="-V -Y \"(ngap || nas-5gs || s1ap || sip || diameter)\" -r {}"

Note also that there do exist some rust pcap libraries...

@phiresky
Copy link
Owner

For simple adapters that use an external tool, creating it is pretty easy, see the pdf extractor for example:
https://github.com/phiresky/ripgrep-all/blob/master/src/adapters/poppler.rs

It would be possible to allow external plugins etc via a config file and just let it run arbitrary external commands, but so far my approach has been to "keep it close" so I can ensure the quality / performance stays high, especially for file types where there exist rust libraries.

@phiresky
Copy link
Owner

Starting with 1.0.0, it's possible to add custom adapters via the config file. If someone has a good suggestion for this file type please post it in show-your-adapter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants