I'm trying to parse a log file and written a python script to parse it
However when I run it in Splunk search app, only the first line is being executed
I had asked this question before , but now I realize it's because of import numpy command
Is there anything special I should do for using numpy commands in a python script, placed in the bin folder
print("Test Message for log")
import numpy
lines = [] # Declare an empty list named "lines"
i=0
end_position=[]
with open ('$SPLUNK_HOME\etc\apps\search\bin\prm_rca.20161129_0000.log', 'rt') as in_file:
for line in in_file: # For each line of text in in_file, where the data is named "line",
print("Test Message within a loop")
lines.append(line.rstrip('\n')) # add that line to our list of lines, stripping newlines.
if "-----------------------------------------------------------------" in line:
end_position.append(i)
i=i+1
Please help
Objective : parse a very complex log file and make some meaningful analysis
... View more