only data with cl1 is getting replaced. I also have data with cl3 which needs to be replaced by ACD85. There is no possibility @ITWhisperer's search should give this half of replacement. But fi...
See more...
only data with cl1 is getting replaced. I also have data with cl3 which needs to be replaced by ACD85. There is no possibility @ITWhisperer's search should give this half of replacement. But first, your search is very inefficient: The third line starting with search should be accomplished in the first line so fewer events are computed. Secondly, using regex on rigidly formatted data (CSV) is a waste and prone to errors. This is what I suggest, using exactly what @ITWhisperer proposed. index=csv sourcetype="miscprocess:csv" source="D:\\automation\\miscprocess\\output_acd.csv" ("\cl3\" OR "\cl1\")
| eval filename = split(_raw, ",")
| eval filesize = mvindex(filename, 1), filelocation = mvindex(filename, 2)
| eval filename = mvindex(filename, 0)
| eval filelocation=if(like(filelocation,"%\cl1%"),"ACD55","ACD85") Also important: Play with the following emulation and compare with your real data: | makeresults
| fields - _*
| eval data=split("012624.1230,13253.10546875,E:\totalview\ftp\acd\cl1\backup_modified\012624.1230
012624.1230,2236.3291015625,E:\totalview\ftp\acd\cl3\backup\012624.1230
012624.1200,13338.828125,E:\totalview\ftp\acd\cl1\backup_modified\012624.1200
012624.1200,2172.1640625,E:\totalview\ftp\acd\cl3\backup\012624.1200
012624.1130,13292.32421875,E:\totalview\ftp\acd\cl1\backup_modified\012624.1130
012624.1130,2231.9658203125,E:\totalview\ftp\acd\cl3\backup\012624.1130
012624.1100,13438.65234375,E:\totalview\ftp\acd\cl1\backup_modified\012624.1100", "
")
| mvexpand data
| rename data AS _raw
| search (\\cl1\\ OR \\cl3\\)
``` the above emulates
index=csv sourcetype="miscprocess:csv" source="D:\\automation\\miscprocess\\output_acd.csv" ("\cl3\" OR "\cl1\")
```
| eval filename = split(_raw, ",")
| eval filesize = mvindex(filename, 1), filelocation = mvindex(filename, 2)
| eval filename = mvindex(filename, 0)
| eval filelocation=if(like(filelocation,"%\cl1%"),"ACD55","ACD85") The output is _raw filelocation filename filesize 012624.1230,13253.10546875,E:\totalview\ftp\acd\cl1\backup_modified\012624.1230 ACD55 012624.1230 13253.10546875 012624.1230,2236.3291015625,E:\totalview\ftp\acd\cl3\backup\012624.1230 ACD85 012624.1230 2236.3291015625 012624.1200,13338.828125,E:\totalview\ftp\acd\cl1\backup_modified\012624.1200 ACD55 012624.1200 13338.828125 012624.1200,2172.1640625,E:\totalview\ftp\acd\cl3\backup\012624.1200 ACD85 012624.1200 2172.1640625 012624.1130,13292.32421875,E:\totalview\ftp\acd\cl1\backup_modified\012624.1130 ACD55 012624.1130 13292.32421875 012624.1130,2231.9658203125,E:\totalview\ftp\acd\cl3\backup\012624.1130 ACD85 012624.1130 2231.9658203125 012624.1100,13438.65234375,E:\totalview\ftp\acd\cl1\backup_modified\012624.1100 ACD55 012624.1100 13438.65234375 As you see, there is no such "partial replacement". You will need to illustrate and explain any discrepancy between real data and this mock data if you don't get the same results.