Quantcast
Channel: Questions in topic: "splunk-enterprise"
Viewing all articles
Browse latest Browse all 47296

Need advice on a complex field extraction

$
0
0
I have some data which are of the following format: CommonPrefix.1.name="Field1",CommonPrefix.1.type="STRING",CommonPrefix.1.status="alive",CommonPrefix.2.name="Field2",CommonPrefix.2.type="NUMBER",CommonPrefix.2.value="3",CommonPrefix.2.status="seen" etc. I would like to extract some fields so that `name` above will become a field name and `status` will become a value. So the data above would yield two extra fields: `Field1=alive` and `Field2=seen`. I know that those numbers always go from 1 to 7, and that `.name` always precedes `.status`. I tried to make a transform like this: In `props.conf`: [MySourceType] TRANSFORMS-myfield1 = transformed_1 ... TRANSFORMS-myfield7 = transformed_7 and in `transforms.conf`: [transformed_1] REGEX = CommonPrefix\.1\.name=”([^”]*)”.*CommonPrefix\.1\.status=”([^”]*)” FORMAT = $1::$2 LOOKAHEAD= 1048576 ... [transformed_7] REGEX = CommonPrefix\.7\.name=”([^”]*)”.*CommonPrefix\.7\.status=”([^”]*)” FORMAT = $1::$2 LOOKAHEAD= 1048576 I'm using LOOKAHEAD because my data are quite long. I tried to use _KEY_1 + _VAL_1 capturing groups as well, instead of or in addition to FORMAT. Nothing worked - the fields are not extracted. Any ideas on what to fix here?

Viewing all articles
Browse latest Browse all 47296

Trending Articles