Hello
I need to extract some text string from existing index field: IMSChargingIdentifier and place it into new, separate field.
New, incoming events should be parsed exactly the same way.
Here is sample record from this field:
PCSF:1-osbc01cfed-0-0-0000000065154a29-00000000001f4cdd
_id
Q5c724oBfJ0gntMI5D_h
_index
occf-test-index
_score
1
String I'm interested in is after dash - first letter, then osbc and next two digits.
What is the recommended way to achieve this?
- custom GROK pattern in the ingest pipeline?
- painless script with regex?
I 've tried use some pattern_definitions but I can't manage it
Would be appreciate for any suggestions.
PUT /_ingest/pipeline/my-ingest-pipeline
{
"description": "extract ImsChargingIdentifier",
"processors": [
{
"grok": {
"field": "occf.IMSChargingIdentifier",
"patterns": ["%codeSBC:NewField"],
"pattern_definitions": {
"codeSbc": "[%{SPACE:spaces}%{WORD:1st-word}.....what else...?]
}
}
}
]
}