class K8sTshark::TsharkPacketCapture
- K8sTshark::TsharkPacketCapture
- Reference
- Object
Defined in:
tasks/utils/k8s_tshark.crConstructors
Class Method Summary
-
.begin_capture_by_label(label_key : String, label_value : String, command : String = "", &block : TsharkPacketCapture -> )
Method to provide a block context for capture by label.
-
.begin_capture_by_node(node : JSON::Any, command : String = "", &block : TsharkPacketCapture -> )
Method to provide a block context for capture by node.
Instance Method Summary
-
#begin_capture_by_label(label_key : String, label_value : String, command : String = "")
Starts a tshark packet capture on the node where the pod with the specified label is running.
-
#begin_capture_by_node(node : JSON::Any, command : String = "")
Starts a tshark packet capture on the specified node.
- #capture_file_path : String
- #capture_file_path=(capture_file_path : String)
- #finalize
-
#get_capture_file_path : String
Retrieves the file path where the capture is stored.
- #pid : Int32 | Nil
- #pid=(pid : Int32 | Nil)
-
#regex_match?(pattern : Regex) : Bool
Checks if any line in the capture file matches the specified regex pattern.
-
#regex_search(pattern : Regex) : Array(String)
Searches the capture file for lines matching the specified regex pattern.
-
#terminate_capture
Terminates the tshark packet capture process.
Constructor Detail
Class Method Detail
Method to provide a block context for capture by label.
Method to provide a block context for capture by node.
Instance Method Detail
Starts a tshark packet capture on the node where the pod with the specified label is running. label_key and label_value: Used to identify the pod's label. command: Parameters to be passed to tshark.
Starts a tshark packet capture on the specified node. node: The node where the capture should be performed. command: Parameters to be passed to tshark. duration: Optional; specifies the capture duration, eliminating the need to call terminate_capture manually.
Checks if any line in the capture file matches the specified regex pattern. Returns true if a match is found, otherwise false.
Searches the capture file for lines matching the specified regex pattern. Returns an array of matching lines.