|
I have the following result set coming from a search:
I need to merge these two fields into a new field "output":
Thanks, Lp |
|
Better answer:
This assumes that field1 and field2 are numeric. If they are not, you can use the following instead:
Note that a semicolon (;) is used as a delimiter, so a semicolon cannot appear in either field1 or field2. Nice learning experience. Thanks.
(01 Jun '12, 07:33)
lpolo
|
|
Here is one way- but there is probably something better
This runs the search twice... This approach is expensive and might not work when dealing with millions of events. Thanks.
(01 Jun '12, 05:18)
lpolo
2
Well give more details. You didn't state that this was going to be used across millions events. Also you need to give more details on the search you're using to generate these fields. Do field1 and field2 belong to the same search result? Do both fields always occur in all events you want to apply this to?
(01 Jun '12, 05:22)
Ayn
|
|
Simply rename the fields to the same name like this and it works!
(I found this after not wanting to deal with delimiters) Yes, you can do this, but given the example in the original question:
Your solution would end up with 3 events, not 6. And your 3 events would have a multi-valued field named BTW, if you wanted, you could also create field aliases that would make your renames "permanent" so that you don't have to do the renames every time.
(08 Oct '12, 21:22)
lguinn ♦
True. My specific use case worked as I was dealing with 6 different log events so the source looks like this: field_1 field_2 1 2 3 5 4 6
(09 Oct '12, 12:54)
e_sherlock
|