Skip to content

Commit 83c8598

Browse files
authored
Added an option to include a filter file
2 parents 10ce207 + 56ca694 commit 83c8598

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/cdqr.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313
###############################################################################
1414
# Created by: Alan Orlikoski
15-
cdqr_version = "CDQR Version: 4.1.9"
15+
cdqr_version = "CDQR Version: 4.2.0"
1616
#
1717
###############################################################################
1818
# Global Variables
@@ -1554,7 +1554,7 @@ def main():
15541554
parser.add_argument('-z',action='store_true', default=False, help='Indicates the input file is a zip file and needs to be decompressed')
15551555
parser.add_argument('--no_dependencies_check',action='store_false', default=True, help='Re-enables the log2timeline the dependencies check. It is skipped by default')
15561556
parser.add_argument('-v','--version', action='version', version=cdqr_version)
1557-
1557+
parser.add_argument('-f', nargs=1, action="store", help='Include a filter file to filter log2timeline output. List of files to include for targeted collection of files to parse, one line per file path')
15581558
args=parser.parse_args()
15591559

15601560
# List to help with logging
@@ -1628,6 +1628,22 @@ def main():
16281628
print("Number of cpu cores to use: "+str(num_cpus))
16291629
log_list.append("Number of cpu cores to use: "+str(num_cpus)+"\n")
16301630

1631+
# Set filter file location
1632+
if args.f:
1633+
filter_file_loc = args.f[0]
1634+
filter_file_loc = filter_file_loc.replace("\\\\","/").replace("\\","/").rstrip("/")
1635+
if filter_file_loc.count("/") > 1:
1636+
filter_file_loc = filter_file_loc.rstrip("/")
1637+
1638+
if not os.path.exists(filter_file_loc):
1639+
print("ERROR: \""+filter_file_loc+"\" cannot be found by the system. Please verify command.")
1640+
print("Exiting...")
1641+
sys.exit(1)
1642+
command1.append("-f")
1643+
command1.append(filter_file_loc)
1644+
print("Filter file being used is: " + filter_file_loc)
1645+
log_list.append("Filter file to use is: " + filter_file_loc)
1646+
16311647
# Set source location/file
16321648
src_loc = args.src_location[0]
16331649
src_loc = src_loc.replace("\\\\","/").replace("\\","/").rstrip("/")

0 commit comments

Comments
 (0)