How would I extract account number here,
message:Receiving exp from: Long URL /Eex for account(s): 8768
rex field=_raw "Exposure for account(s):\s+(?[^,]+)"
It neither brings result nor error.
Your message sample says /Eex, your regex starts with "Exposure". Is that just a typo or so in your sample, otherwise that could be one of the issues.
Also:
( character, you need to escape itTo keep it simple (you can enhance it if you need), something like this should work:
| rex field=_raw "account\(s\):\s+(?<account_number>\d+)"
See also: https://regex101.com/r/ELFlV3/1
can you please elaborate? I'm fairly new to splunk
Sure! This isn't a Splunk thing per se, but rather more about how to post your question here. It looks like part of your rex command is getting eaten up by the formatting here, so it's hard to diagnose.
When you post code, it's best to click the button that looks like 101010 so that your code can be escaped and all characters preserved. If you can't find that button, you can use a single backtick (the character at the top left of your keyboard, on the same key as the ~ tilde) before and after your code.