I have an app on a deployment server that runs a script and has splunk ingest the output which is valid xml. I've added a props.conf on the Search Heads with KV_MODE=xml but no fields are being extracted. When I run | xmlkv at the end of my query it extracts all xml fields. Is there anything I'm missing that would cause Splunk not to extract the xml fields automatically?
Thanks in advance
This issue was that the app was not visible and in scope with the user. This issue was resolved by adding a metadata file in the SHC app as follows
shcluster/apps/appname/metadata/
File: default.meta
[]
export=system
This issue was that the app was not visible and in scope with the user. This issue was resolved by adding a metadata file in the SHC app as follows
shcluster/apps/appname/metadata/
File: default.meta
[]
export=system
| makeresults
| eval _raw="<m:properties>
<d:GenID m:type=\"Edm.String\">xxx</d:GenID>
<d:PLANT_ID m:type=\"Edm.String\">xxx</d:PLANT_ID>
<d:TOTAL_SD_LINES m:type=\"Edm.Double\">xxx</d:TOTAL_SD_LINES>
<d:TOTAL_SD_LINES_WO_DELV m:type=\"Edm.Double\">xxx</d:TOTAL_SD_LINES_WO_DELV>
<d:TOTAL_DELV_LINES m:type=\"Edm.Double\">xxx</d:TOTAL_DELV_LINES>
<d:TOTAL_DELV_LINES_WO_TO m:type=\"Edm.Double\">xxx</d:TOTAL_DELV_LINES_WO_TO>
<d:TOTAL_TO_LINES m:type=\"Edm.Double\">xxx</d:TOTAL_TO_LINES>
<d:TOTAL_TO_LINES_CONFIRMED m:type=\"Edm.Double\">xxx</d:TOTAL_TO_LINES_CONFIRMED>
<d:TOTAL_TO_LINES_NOT_CONFIRMED m:type=\"Edm.Double\">xx</d:TOTAL_TO_LINES_NOT_CONFIRMED>
</m:properties>
<m:properties>
<d:GenID m:type=\"Edm.String\">xxx</d:GenID>
<d:PLANT_ID m:type=\"Edm.String\">xxx</d:PLANT_ID>
<d:TOTAL_SD_LINES m:type=\"Edm.Double\">xxx</d:TOTAL_SD_LINES>
<d:TOTAL_SD_LINES_WO_DELV m:type=\"Edm.Double\">xxx</d:TOTAL_SD_LINES_WO_DELV>
<d:TOTAL_DELV_LINES m:type=\"Edm.Double\">xxx</d:TOTAL_DELV_LINES>
<d:TOTAL_DELV_LINES_WO_TO m:type=\"Edm.Double\">xxx</d:TOTAL_DELV_LINES_WO_TO>
<d:TOTAL_TO_LINES m:type=\"Edm.Double\">yyy</d:TOTAL_TO_LINES>
<d:TOTAL_TO_LINES_CONFIRMED m:type=\"Edm.Double\">xxx</d:TOTAL_TO_LINES_CONFIRMED>
<d:TOTAL_TO_LINES_NOT_CONFIRMED m:type=\"Edm.Double\">xx</d:TOTAL_TO_LINES_NOT_CONFIRMED>
</m:properties>"
| rex mode=sed "s/(?ms)([\r\n\s]+)\<m/#<m/g"
| makemv delim="#" _raw
| stats count by _raw
| xmlkv
For this result, props.conf is following:
[yoursourcetype]
SHOULD_LINEMERGE=false
LINE_BREAKER=([\r\n\s]+)\<m
NO_BINARY_CHECK=true
CHARSET=UTF-8
disabled=false
KV_MODE=xml
DATETIME_CONFIG=CURRENT
TRUNCATE=0
How about this?
Can you please provide raw data (mask any sensitive information) ? This answer might help you https://answers.splunk.com/answers/744449/how-to-parse-out-fields.html
<d:GenID m:type="Edm.String">xxx</d:GenID>
<d:PLANT_ID m:type="Edm.String">xxx</d:PLANT_ID>
<d:TOTAL_SD_LINES m:type="Edm.Double">xxx</d:TOTAL_SD_LINES>
<d:TOTAL_SD_LINES_WO_DELV m:type="Edm.Double">xxx</d:TOTAL_SD_LINES_WO_DELV>
<d:TOTAL_DELV_LINES m:type="Edm.Double">xxx</d:TOTAL_DELV_LINES>
<d:TOTAL_DELV_LINES_WO_TO m:type="Edm.Double">xxx</d:TOTAL_DELV_LINES_WO_TO>
<d:TOTAL_TO_LINES m:type="Edm.Double">xxx</d:TOTAL_TO_LINES>
<d:TOTAL_TO_LINES_CONFIRMED m:type="Edm.Double">xxx</d:TOTAL_TO_LINES_CONFIRMED>
<d:TOTAL_TO_LINES_NOT_CONFIRMED m:type="Edm.Double">xx</d:TOTAL_TO_LINES_NOT_CONFIRMED>
</m:properties>
Can you post props.conf?
[mysourcetype]
SHOULD_LINEMERGE=true
LINE_BREAKER=([\r\n]+)
NO_BINARY_CHECK=true
BREAK_ONLY_BEFORE=^\s+(<\w+:\w+>)
CHARSET=UTF-8
disabled=false
KV_MODE=xml
DATETIME_CONFIG=CURRENT
TRUNCATE=10000
This is the same props I have on the deployment server as well as the search heads