test_class.file: hendrix-interceptors/interceptor-aws/src/test/java/io/symcpe/hendrix/interceptor/aws/TestVPCFlowLogParser.java
test_class.identifier: TestVPCFlowLogParser
test_case.body: @Test
  	public void testRecordParsingNoData() throws InterceptException {
  		String val = "2 123456789010 eni-1a2b3c4d - - - - - - - 1431280876 1431280934 - NODATA";
  		VPCFlowLogRecord record = VPCFlowLogParser.parseToRecord(val);
  		assertNotNull(record);
  		assertEquals((short) 2, record.getVersion());
  		assertEquals("123456789010", record.getAccountId());
  		assertEquals("eni-1a2b3c4d", record.getInterfaceId());
  		assertEquals(1431280876, record.getStartTs());
  		assertEquals(1431280934, record.getEndTs());
  		assertEquals((byte) "N".charAt(0), record.getLogStatus());
  	}
test_case.class_method_signature: TestVPCFlowLogParser.testRecordParsingNoData()
test_case.full_signature: @Test public void testRecordParsingNoData()
test_case.identifier: testRecordParsingNoData
test_case.invocations: parseToRecord assertNotNull assertEquals getVersion assertEquals getAccountId assertEquals getInterfaceId assertEquals getStartTs assertEquals getEndTs assertEquals charAt getLogStatus
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testRecordParsingNoData()
focal_class.declarator: STATUS_CODE_ZERO = 'O'
focal_class.modifier: private static final
focal_class.original_string: private static final char STATUS_CODE_ZERO = 'O';
focal_class.type: char
focal_class.var_name: STATUS_CODE_ZERO
focal_class.declarator: MESSAGE = "message"
focal_class.modifier: private static final
focal_class.original_string: private static final String MESSAGE = "message";
focal_class.type: String
focal_class.var_name: MESSAGE
focal_class.declarator: ID = "id"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID = "id";
focal_class.type: String
focal_class.var_name: ID
focal_class.declarator: TIMESTAMP2 = "timestamp"
focal_class.modifier: private static final
focal_class.original_string: private static final String TIMESTAMP2 = "timestamp";
focal_class.type: String
focal_class.var_name: TIMESTAMP2
focal_class.declarator: TIMESTAMP = "@timestamp"
focal_class.modifier: private static final
focal_class.original_string: private static final String TIMESTAMP = "@timestamp";
focal_class.type: String
focal_class.var_name: TIMESTAMP
focal_class.declarator: LOG_EVENTS = "logEvents"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_EVENTS = "logEvents";
focal_class.type: String
focal_class.var_name: LOG_EVENTS
focal_class.declarator: LOG_STREAM = "logStream"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_STREAM = "logStream";
focal_class.type: String
focal_class.var_name: LOG_STREAM
focal_class.declarator: LOG_GROUP = "logGroup"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_GROUP = "logGroup";
focal_class.type: String
focal_class.var_name: LOG_GROUP
focal_class.declarator: ACCEPT = "ACCEPT"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCEPT = "ACCEPT";
focal_class.type: String
focal_class.var_name: ACCEPT
focal_class.declarator: LOG_STATUS = "log-status"
focal_class.modifier: private static final
focal_class.original_string: private static final String LOG_STATUS = "log-status";
focal_class.type: String
focal_class.var_name: LOG_STATUS
focal_class.declarator: ACCEPTED = "accepted"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCEPTED = "accepted";
focal_class.type: String
focal_class.var_name: ACCEPTED
focal_class.declarator: END = "end"
focal_class.modifier: private static final
focal_class.original_string: private static final String END = "end";
focal_class.type: String
focal_class.var_name: END
focal_class.declarator: START = "start"
focal_class.modifier: private static final
focal_class.original_string: private static final String START = "start";
focal_class.type: String
focal_class.var_name: START
focal_class.declarator: BYTES = "bytes"
focal_class.modifier: private static final
focal_class.original_string: private static final String BYTES = "bytes";
focal_class.type: String
focal_class.var_name: BYTES
focal_class.declarator: PACKETS = "packets"
focal_class.modifier: private static final
focal_class.original_string: private static final String PACKETS = "packets";
focal_class.type: String
focal_class.var_name: PACKETS
focal_class.declarator: PROTOCOL = "protocol"
focal_class.modifier: private static final
focal_class.original_string: private static final String PROTOCOL = "protocol";
focal_class.type: String
focal_class.var_name: PROTOCOL
focal_class.declarator: DSTPORT = "dstport"
focal_class.modifier: private static final
focal_class.original_string: private static final String DSTPORT = "dstport";
focal_class.type: String
focal_class.var_name: DSTPORT
focal_class.declarator: SRCPORT = "srcport"
focal_class.modifier: private static final
focal_class.original_string: private static final String SRCPORT = "srcport";
focal_class.type: String
focal_class.var_name: SRCPORT
focal_class.declarator: DSTADDR = "dstaddr"
focal_class.modifier: private static final
focal_class.original_string: private static final String DSTADDR = "dstaddr";
focal_class.type: String
focal_class.var_name: DSTADDR
focal_class.declarator: SRCADDR = "srcaddr"
focal_class.modifier: private static final
focal_class.original_string: private static final String SRCADDR = "srcaddr";
focal_class.type: String
focal_class.var_name: SRCADDR
focal_class.declarator: INTERFACE_ID = "interface-id"
focal_class.modifier: private static final
focal_class.original_string: private static final String INTERFACE_ID = "interface-id";
focal_class.type: String
focal_class.var_name: INTERFACE_ID
focal_class.declarator: ACCOUNT_ID = "account-id"
focal_class.modifier: private static final
focal_class.original_string: private static final String ACCOUNT_ID = "account-id";
focal_class.type: String
focal_class.var_name: ACCOUNT_ID
focal_class.declarator: VERSION = "version"
focal_class.modifier: private static final
focal_class.original_string: private static final String VERSION = "version";
focal_class.type: String
focal_class.var_name: VERSION
focal_class.declarator: FLOW_RECORD_REGEX = "(\\d)" // version
  			+ "\\s(.*)" // account-id
  			+ "\\s(.*-.*)" // interface-id
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // srcaddr
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // dstaddr
  			+ "\\s(\\d{1,5}|\\-)" // srcport
  			+ "\\s(\\d{1,5}|\\-)" // dstport
  			+ "\\s(\\d{1,3}|\\-)" // protocol
  			+ "\\s(\\d+|\\-)" // packets
  			+ "\\s(\\d+|\\-)" // bytes
  			+ "\\s(\\d+)" // start
  			+ "\\s(\\d+)" // end
  			+ "\\s(ACCEPT|REJECT|\\-)" // action
  			+ "\\s(OK|NODATA|SKIPDATA)"
focal_class.modifier: private static final
focal_class.original_string: private static final String FLOW_RECORD_REGEX = "(\\d)" // version
  			+ "\\s(.*)" // account-id
  			+ "\\s(.*-.*)" // interface-id
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // srcaddr
  			+ "\\s(\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}\\.\\d{1,4}|\\-)" // dstaddr
  			+ "\\s(\\d{1,5}|\\-)" // srcport
  			+ "\\s(\\d{1,5}|\\-)" // dstport
  			+ "\\s(\\d{1,3}|\\-)" // protocol
  			+ "\\s(\\d+|\\-)" // packets
  			+ "\\s(\\d+|\\-)" // bytes
  			+ "\\s(\\d+)" // start
  			+ "\\s(\\d+)" // end
  			+ "\\s(ACCEPT|REJECT|\\-)" // action
  			+ "\\s(OK|NODATA|SKIPDATA)";
focal_class.type: String
focal_class.var_name: FLOW_RECORD_REGEX
focal_class.declarator: FLOW_RECORD_PATTERN = Pattern.compile(FLOW_RECORD_REGEX)
focal_class.modifier: private static final
focal_class.original_string: private static final Pattern FLOW_RECORD_PATTERN = Pattern.compile(FLOW_RECORD_REGEX);
focal_class.type: Pattern
focal_class.var_name: FLOW_RECORD_PATTERN
focal_class.declarator: gson
focal_class.modifier: private
focal_class.original_string: private Gson gson;
focal_class.type: Gson
focal_class.var_name: gson
focal_class.file: hendrix-interceptors/interceptor-aws/src/main/java/io/symcpe/hendrix/interceptor/aws/VPCFlowLogParser.java
focal_class.identifier: VPCFlowLogParser
focal_class.class_method_signature: VPCFlowLogParser.VPCFlowLogParser()
focal_class.full_signature: public  VPCFlowLogParser()
focal_class.identifier: VPCFlowLogParser
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VPCFlowLogParser()
focal_class.class_method_signature: VPCFlowLogParser.parseFlowLogMap(String json)
focal_class.full_signature: public List<Map<String, Object>> parseFlowLogMap(String json)
focal_class.identifier: parseFlowLogMap
focal_class.modifiers: public
focal_class.parameters: (String json)
focal_class.return: List<Map<String, Object>>
focal_class.signature: List<Map<String, Object>> parseFlowLogMap(String json)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(Map<String, Object> map, String line)
focal_class.full_signature: public static void parseToRecord(Map<String, Object> map, String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (Map<String, Object> map, String line)
focal_class.return: void
focal_class.signature: void parseToRecord(Map<String, Object> map, String line)
focal_class.class_method_signature: VPCFlowLogParser.parseFlowLogJson(EventFactory factory, String json)
focal_class.full_signature: public List<Event> parseFlowLogJson(EventFactory factory, String json)
focal_class.identifier: parseFlowLogJson
focal_class.modifiers: public
focal_class.parameters: (EventFactory factory, String json)
focal_class.return: List<Event>
focal_class.signature: List<Event> parseFlowLogJson(EventFactory factory, String json)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(Event event, String line)
focal_class.full_signature: public static void parseToRecord(Event event, String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (Event event, String line)
focal_class.return: void
focal_class.signature: void parseToRecord(Event event, String line)
focal_class.class_method_signature: VPCFlowLogParser.parseToRecord(String line)
focal_class.full_signature: public static VPCFlowLogRecord parseToRecord(String line)
focal_class.identifier: parseToRecord
focal_class.modifiers: public static
focal_class.parameters: (String line)
focal_class.return: VPCFlowLogRecord
focal_class.signature: VPCFlowLogRecord parseToRecord(String line)
focal_method.body: public static void parseToRecord(Map<String, Object> map, String line) throws InterceptException {
  		Matcher matcher = FLOW_RECORD_PATTERN.matcher(line);
  		if (matcher.matches()) {
  			try {
  				map.put(VERSION, Short.parseShort(matcher.group(1)));
  				map.put(ACCOUNT_ID, matcher.group(2));
  				map.put(INTERFACE_ID, matcher.group(3));
  				if (matcher.group(14).charAt(0) == STATUS_CODE_ZERO) {
  					map.put(SRCADDR, matcher.group(4));
  					map.put(DSTADDR, matcher.group(5));
  					map.put(SRCPORT, Integer.parseInt(matcher.group(6)));
  					map.put(DSTPORT, Integer.parseInt(matcher.group(7)));
  					map.put(PROTOCOL, matcher.group(8).charAt(0));
  					map.put(PACKETS, Integer.parseInt(matcher.group(9)));
  					map.put(BYTES, Integer.parseInt(matcher.group(10)));
  				}
  				map.put(START, Integer.parseInt(matcher.group(11)));
  				map.put(END, Integer.parseInt(matcher.group(12)));
  				map.put(ACCEPTED, matcher.group(13).equals(ACCEPT));
  				map.put(LOG_STATUS, (byte) matcher.group(14).charAt(0));
  			} catch (Exception e) {
  				throw new InterceptException(e);
  			}
  		} else {
  			throw new InterceptException("Line doesn't match flow record:" + line);
  		}
  	}
focal_method.class_method_signature: VPCFlowLogParser.parseToRecord(Map<String, Object> map, String line)
focal_method.full_signature: public static void parseToRecord(Map<String, Object> map, String line)
focal_method.identifier: parseToRecord
focal_method.invocations: matcher matches put parseShort group put group put group charAt group put group put group put parseInt group put parseInt group put charAt group put parseInt group put parseInt group put parseInt group put parseInt group put equals group put charAt group
focal_method.modifiers: public static
focal_method.parameters: (Map<String, Object> map, String line)
focal_method.return: void
focal_method.signature: void parseToRecord(Map<String, Object> map, String line)