All Posts

Find Answers
Ask questions. Get answers. Find technical product solutions from passionate members of the Splunk community.

All Posts

that worked ! Thanks so much for your help. I really appreciate it !
If I were to be nitpicky I'd say that it captures stuff like 000.999.123.987, which is not a valid IP
Actually, I believe the docs are correct since BREAK_ONLY_BEFORE applies to the line-merging stage which - if enabled - happens after line breaking. Anyway, @jackin  unless you have a very, very pec... See more...
Actually, I believe the docs are correct since BREAK_ONLY_BEFORE applies to the line-merging stage which - if enabled - happens after line breaking. Anyway, @jackin  unless you have a very, very peculiar use case, as a rule of thumb you should never enable line-merging. It is resource-intensive and most often you can achieve the same result by simply chosing a proper line breaker. So, how I would approach this - I'd firstly try to use the default ([\r\n]+) linebreaker and check if the stream gets broken into separate lines (disable SHOULD_LINEMERGE!). If it does, you can start searching how to anchor the breaker to the opening bracket. If it doesn't, that means you have some other characters in your data stream and you have to check what it is.
@pjac1029  I reviewed the XML and implemented the solution using a token prefix strategy combined with test data via makeresults (since I currently don't have real firewall data). I replaced the <d... See more...
@pjac1029  I reviewed the XML and implemented the solution using a token prefix strategy combined with test data via makeresults (since I currently don't have real firewall data). I replaced the <done> block with a <change> block in the dropdown input to ensure that the prefix logic (e.g., "prod\") applies every time the user changes the selection. This resolved the issue where the token was only set once. I also validated the dropdown behavior and confirmed that event filtering works as expected based on the selected username. <dashboard version="1.1"> <label>Firewall Blocks Dashboard (Test Data)</label> <fieldset submitButton="false" autoRun="true"> <input type="dropdown" token="raw_username" searchWhenChanged="true"> <label>Select Username</label> <fieldForLabel>username</fieldForLabel> <fieldForValue>username</fieldForValue> <search> <query>| inputlookup test_users.csv | table username</query> </search> <change> <set token="username">prod\\$value$</set> </change> </input> </fieldset> <row> <panel> <table> <search> <query> | makeresults | eval user="prod\\john.doe", action="blocked" | append [| makeresults | eval user="prod\\jane.smith", action="allowed"] | append [| makeresults | eval user="prod\\bob.jones", action="blocked"] | search user="$username$" | table user action </query> <earliest>-7d@h</earliest> <latest>now</latest> </search> </table> </panel> </row> </dashboard>        
I created a  dashboard with an input  that allows the user to select a user field from a dropdown that's populated by a lookup table.   I want to prefix the selected user with "production\" and r... See more...
I created a  dashboard with an input  that allows the user to select a user field from a dropdown that's populated by a lookup table.   I want to prefix the selected user with "production\" and run a query In a panel that retrieves firewall events  where the user = the new token value (prefixed with "production\") since the user in the firewall index is prefixed with "production". The first time I select the user from the lookup the query retrieves  events. the next time I select another user the set token does not prefix the token with "production". instead it searches with the user selected value and returns no events. the done block apparently only executes the first time through below is xml. Thanks in advance. <label>firewall blocks</label> <fieldset submitButton="false" autoRun="true"> <input type="dropdown" token="username" searchWhenChanged="true"> <label>username</label> <fieldForLabel>username</fieldForLabel> <fieldForValue>username</fieldForValue> <search> <query>| inputlookup test_users.csv | table username</query> <earliest>-24h@h</earliest> <latest>now</latest> <done> <set token="username">prod\\$username$</set> </done> </search> </input> </fieldset> <row> <panel> <table> <search> <query> index=firewall sourcetype=firewall user = "$username$" | table $username$ user action </query> <earliest>-7d@h</earliest> <latest>now</latest> </search> <option name="drilldown">none</option> </table> </panel>
I contend the documentation is incorrect.  LINE_BREAKER and BREAK_ONLY_BEFORE are contradictory and shouldn't be used together.  At the very least, great care should be used to ensure the two setting... See more...
I contend the documentation is incorrect.  LINE_BREAKER and BREAK_ONLY_BEFORE are contradictory and shouldn't be used together.  At the very least, great care should be used to ensure the two settings work properly.
First of all thanks for your reply. I ran the following search in Splunk: index="wazuh-alerts" "data.vulnerability.severity"="Medium" | stats count I also tested for other severity levels like "Hi... See more...
First of all thanks for your reply. I ran the following search in Splunk: index="wazuh-alerts" "data.vulnerability.severity"="Medium" | stats count I also tested for other severity levels like "High" and "Low," but the result was always 0. This indicates that no vulnerability detection events are being indexed in Splunk. Even though other types of data are coming through, there are currently no events where data.vulnerability.severity is populated with "High," "Medium," or "Low." It suggests that either: Vulnerability Detector is not generating results, The events are not being forwarded to Splunk properly, Or the events are being indexed but under a different sourcetype, index, or field structure. Would appreciate any guidance on how to dig deeper into this!
Hi @Alan_Chan , this transformation is unuseful on the SH, but it must be localized in the first HF that dara pass trhough, are you sure that you applied it in the first HF? Then check if the sourc... See more...
Hi @Alan_Chan , this transformation is unuseful on the SH, but it must be localized in the first HF that dara pass trhough, are you sure that you applied it in the first HF? Then check if the sourcetype where you associated the SEDCMD command is the correct one, and that there isn't any transformation on this sourcetype. Then, are you sure that is useful to remove these few chars? Ciao. Giuseppe
Hi @kunalsingh , good for you, see next time! Ciao and happy splunking Giuseppe P.S.: Karma Points are appreciated by all the contributors
I am trying to remove everything before the { character to preserve the JSON format. I am using SEDCMD-keepjson = s/^[^{]{/{/ in the sourcetype configuration, but it fails to apply correctly. However... See more...
I am trying to remove everything before the { character to preserve the JSON format. I am using SEDCMD-keepjson = s/^[^{]{/{/ in the sourcetype configuration, but it fails to apply correctly. However, when I use the search command | rex mode=sed "s/^[^{]{/{/", it successfully removes the unwanted text. I am wondering what could be causing this issue. The sourcetype settings are configured on both the Search Head (SH) and Heavy Forwarder (HF) Mar 28 13:11:57 abcdeabcdev01w.abcdabcd.local {<json_log>}  
Hi @kunalsingh  Use a REPORT transform in props.conf and transforms.conf to define the field extractions based on your delimiters. ==props.conf== [your_sourcetype] # Replace your_sourcetype with t... See more...
Hi @kunalsingh  Use a REPORT transform in props.conf and transforms.conf to define the field extractions based on your delimiters. ==props.conf== [your_sourcetype] # Replace your_sourcetype with the actual sourcetype of your data REPORT-kv_pairs = extract_custom_kv ==transforms.conf== [extract_custom_kv] REGEX = ([^=\^]+)=([^\^]*) FORMAT = $1::$2 MV_ADD = true This configuration defines a field extraction named extract_custom_kv. REGEX = ([^=\^]+)=([^\^]*): This regular expression finds key-value pairs separated by =. ([^=\^]+) captures the key (any character except = or ^). = matches the literal equals sign. ([^\^]*) captures the value (any character except ^, including an empty string). This correctly handles fields like documentName= where the value is empty. FORMAT = $1::$2: This assigns the captured key (group 1) and value (group 2) to a Splunk field. MV_ADD = true: Ensures that if multiple key-value pairs are found in a single event, they are all extracted. Check a working example at https://regex101.com/r/yAjRVa/1 This method correctly identifies the ^ character as the delimiter between pairs and = as the separator within a pair, handling empty values appropriately. The regex you provided, ^([^=]+)=([^^\]), likely failed because the ^ anchor restricts it to the start of the string, and the character class [^^\*] might not behave as expected compared to [^\^].   Did this answer help you? If so, please consider: Adding karma to show it was useful Marking it as the solution if it resolved your issue Commenting if you need any clarification Your feedback encourages the volunteers in this community to continue contributing
Hi @luminousplumz  You need to apply the mqtttopic transform before the mqtttojson transform overwrites the _raw field. The order in TRANSFORMS-* matters. Also, adjust the mqtttopic regex and format... See more...
Hi @luminousplumz  You need to apply the mqtttopic transform before the mqtttojson transform overwrites the _raw field. The order in TRANSFORMS-* matters. Also, adjust the mqtttopic regex and format for correct field extraction. transforms.conf: [mqtttojson] REGEX = msg\=(.+) FORMAT = $1 DEST_KEY = _raw [mqtttopic] # Extract from the original _raw field containing 'topic=' REGEX = topic=tgw\/data\/0x155f\/([^\/]+) FORMAT = Topic::$1 WRITE_META = true props.conf: [mqtttojson_ubnpfc_all] # Apply mqtttopic first, then mqtttojson TRANSFORMS-topic_then_json = mqtttopic, mqtttojson # The rest of your props.conf settings remain the same DATETIME_CONFIG = LINE_BREAKER = ([\r\n]+) NO_BINARY_CHECK = true TIME_PREFIX = \"ts\": TZ = Europe/London category = Custom pulldown_type = 1 # Ensure KV_MODE=none if you don't want Splunk's default key-value extraction # KV_MODE = none # Ensure JSON extraction runs after transforms if needed # INDEXED_EXTRACTIONS = json Transform Order: The TRANSFORMS-topic_then_json line in props.conf should have mqtttopic first. This ensures it runs on the original event data before mqtttojson overwrites _raw with the JSON payload. mqtttopic REGEX: The regex topic=tgw\/data\/0x155f\/([^\/]+) specifically looks for the topic= string, skips the known prefix tgw/data/0x155f/, and captures the next segment of characters that are not a forward slash (/) into capture group 1. mqtttopic FORMAT: FORMAT = Topic::$1 creates a new field named Topic containing the value captured by the regex (the desired topic segment, e.g., "TransportContextTracking"). mqtttopic WRITE_META: WRITE_META = true ensures the extracted field (Topic) is written to the index metadata, making it available for searching even though the original _raw field is later overwritten. mqtttojson: This transform runs second. It extracts the JSON part from the msg= field (which still exists in the original event data at this stage) and overwrites _raw with just the JSON content. Splunk's automatic JSON parsing (or INDEXED_EXTRACTIONS = json) will then parse this new _raw. Some useful tips: Restart the Splunk instance or reload the configuration for changes in props.conf and transforms.conf to take effect. Ensure the sourcetype mqtttojson_ubnpfc_all is correctly assigned to your MQTT data input. Test the regex using Splunk's rex command in search or on regex testing websites against your raw event data to confirm it captures the correct value. If Splunk's automatic key-value extraction interferes before your transforms run, you might need KV_MODE = none in props.conf. If Splunk isn't automatically parsing the final JSON _raw, add INDEXED_EXTRACTIONS = json to your props.conf stanza. Did this answer help you? If so, please consider: Adding karma to show it was useful Marking it as the solution if it resolved your issue Commenting if you need any clarification Your feedback encourages the volunteers in this community to continue contributing
| rex "(?<ip>\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})(?=:\d+)"
I would like to extract an ip address from a text field where the ip address has a trailing port number. The text is like so:  X-Upstream:"11.111.11.11:81" The extraction would provide only the ip ... See more...
I would like to extract an ip address from a text field where the ip address has a trailing port number. The text is like so:  X-Upstream:"11.111.11.11:81" The extraction would provide only the ip address. Thanks.
Hi @luminousplumz, For index-time field extractions, you want something like this (note the order of the transforms in the TRANSFORMS-mqtt setting): # fields.conf [sourcetype::mqtttojson_ubnpfc_al... See more...
Hi @luminousplumz, For index-time field extractions, you want something like this (note the order of the transforms in the TRANSFORMS-mqtt setting): # fields.conf [sourcetype::mqtttojson_ubnpfc_all::Topic] INDEXED = true # props.conf [mqtttojson_ubnpfc_all] TRANSFORMS-mqtt = mqtttopic,mqtttojson # transforms.conf [mqtttojson] CLEAN_KEYS = 0 DEST_KEY = _raw FORMAT = $1 REGEX = msg=(.+) [mqtttopic] CLEAN_KEYS = 0 FORMAT = Topic::$1 REGEX = topic=(?:[^/]*/){3}([^/]+) WRITE_META = true  For search-time field extractions, you want something like this: [mqtttojson_ubnpfc_all] EXTRACT-Topic = topic=(?:[^/]*/){3}(?<Topic>[^/]+) EVAL-_raw = replace(_raw, ".*? msg=", "")  However, in the search-time configuration, you'll need to extract the JSON fields in a search as automatic key-value field extraction happens before calculated fields (EVAL-*): sourcetype=mqtttojson_ubnpfc_all | spath You'll note that the original name, event_id, topic, and msg (value possibly truncated) fields are automatically extracted before the full value of msg is assigned to _raw.
Hi @kunalsingh , please try this: \^([^\=]+)=([^\^]*) Ciao. Giuseppe
Hi @SPL_Dummy , no, you can set the rendexXml option true or false for an input and not for a part of it. To use this Correlation Search, create a new one clonit it and modifying the sourcetype con... See more...
Hi @SPL_Dummy , no, you can set the rendexXml option true or false for an input and not for a part of it. To use this Correlation Search, create a new one clonit it and modifying the sourcetype contained in the macros. Ciao. Giuseppe
Hi @ranafge  The first thing I would try here is opening some of the searches in the dashboards in Search (Click the little magnifying glass) and check for any errors.  If still no results then you... See more...
Hi @ranafge  The first thing I would try here is opening some of the searches in the dashboards in Search (Click the little magnifying glass) and check for any errors.  If still no results then you can try removing various parts of the search to see if there is a particular line which is causing the issue, if this happens let us know the specifics and we can work out what the issue is.  Did this answer help you? If so, please consider: Adding karma to show it was useful Marking it as the solution if it resolved your issue Commenting if you need any clarification Your feedback encourages the volunteers in this community to continue contributing
Hello Splunk Community, I'm seeking help regarding an issue I’m facing. The main problem is that vulnerability detection data is not showing up in my Splunk dashboard. Wazuh is installed and runni... See more...
Hello Splunk Community, I'm seeking help regarding an issue I’m facing. The main problem is that vulnerability detection data is not showing up in my Splunk dashboard. Wazuh is installed and running correctly, and other data appears to be coming through, but the vulnerability detection events are missing. I've verified that: Wazuh services are running properly without critical errors. Vulnerability Detector is enabled in the Wazuh configuration (ossec.conf). Wazuh agents are reporting other types of events successfully. Despite this, no vulnerability data appears in the dashboard. Could someone guide me on how to troubleshoot this? Any advice on checking Wazuh modules, Splunk sourcetypes, indexes, or forwarder configurations would be highly appreciated. Thank you in advance for your support!
If you really dont want to go down the multisite route then you could keep your RF at 3 and slowly introduce new indexers in the new location, offlining one from the old site as each new one is added... See more...
If you really dont want to go down the multisite route then you could keep your RF at 3 and slowly introduce new indexers in the new location, offlining one from the old site as each new one is added, although I really would recommend the multisite approach personally... Here is what you would do: Add all 3 new indexers to Site B while keeping Site A indexers active Wait for full data replication to new indexers (verify with) Gracefully decommission Site A indexers one at a time, waiting full rebalancing of buckets before doing the next one - splunk offline -auth <admin>:<password> Cluster automatically rebalances data to maintain RF=3 during decommissioning Why This Works as an approach Maintains RF=3 compliance throughout Avoids dangerous RF reduction step Uses Splunk's built-in rebalancing for safe peer removal   Did this answer help you? If so, please consider: Adding karma to show it was useful Marking it as the solution if it resolved your issue Commenting if you need any clarification Your feedback encourages the volunteers in this community to continue contributing