Grep plugin - no match

Hi guys,

Im using the plugin grep ver.1.0.3

Im simply trying to match any line that contains “spf”, but still no luck!

Check the output

rapid7/Grep:1.0.3. Step name: match_string
echo ‘i=1; mx.google.com;
dkim=pass header.i=@----------.com header.s=google header.b=TgyIcQPZ;
spf=pass (google.com: domain of ---------------@-------.com designates 209.85.220.41 as permitted sender) smtp.mailfrom=-------------@-------------.com;
dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=---------------.com’ | egrep spf > /tmp/tmprxml9y90/results.txt
No Matches found
[Errno 2] No such file or directory: ‘/tmp/tmprxml9y90/results.txt’
[Errno 2] No such file or directory: ‘/tmp/tmprxml9y90/’
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/komand-1.0.1-py3.7.egg/komand/plugin.py”, line 311, in handle_step
output = self.start_step(input_message[‘body’], ‘action’, logger, log_stream, is_test, is_debug)
File “/usr/local/lib/python3.7/site-packages/komand-1.0.1-py3.7.egg/komand/plugin.py”, line 419, in start_step
output = func(params)
File “/usr/local/lib/python3.7/site-packages/grep_rapid7_plugin-1.0.3-py3.7.egg/icon_grep/actions/match_string/action.py”, line 21, in run
params.get(Input.BEHAVIOR)
File “/usr/local/lib/python3.7/site-packages/grep_rapid7_plugin-1.0.3-py3.7.egg/icon_grep/util/utils.py”, line 56, in process_grep
shutil.rmtree(TEMP_PATH)
File “/usr/local/lib/python3.7/shutil.py”, line 482, in rmtree
onerror(os.lstat, path, sys.exc_info())
File “/usr/local/lib/python3.7/shutil.py”, line 480, in rmtree
orig_st = os.lstat(path)
FileNotFoundError: [Errno 2] No such file or directory: ‘/tmp/tmprxml9y90/’

What’s your input in the “Pattern” field look like? If you have spf in quotes, could you try removing the quotes?

@holly_wilsey

I only have spf without quotes or anything else.

I’ve replaced it with a pattern match (regex) but still don’t get grep to work.

I just did some additional testing here, and initially I saw grep working as expected, but then I started inconsistently seeing an error similar to yours. I’m going to file a ticket so we can look into this further.

Thanks Holly,

Let us know if a new ver is launched! :slight_smile:

1 Like