Hello Everyone , i am trying to create a unique fingerprint figure print according to upc + displayName and upc + selectedModifiersCombined with the conditions
Here are 4 orders after splitting in logstash
{
orderId: "1548"
items:{
"upc": "1236",
"displayName": "Coffee"
"selectedModifiersCombined": "Coffee Large Hot"}
}
{
orderId: "1648"
items:{
"upc": "1236",
"displayName": "Coffee",
"selectedModifiersCombined": "Coffee Large Hot"}
}{
orderId: "16468"
items:{
"upc": "12386",
"displayName": "Chicken Curry"
}
}{
orderId: "17468"
items:{
"upc": "12386",
"displayName": "Chicken Curry"
}
}I have used this code in order to create this but its create different fingerprints
if [items][selectedModifiers] and [items][selectedModifiers][0] {
fingerprint {
source => ["[items][upc]", "[items][selectedModifiersCombined]"]
target => "fingerprint"
method => "SHA1"
concatenate_all_fields => "true"
}
} else {
fingerprint {
source => ["[items][upc]", "[items][displayName]"]
target => "fingerprint"
method => "SHA1"
concatenate_all_fields => "true"
}
}So why it's not generating same fingerprint for same type of itemshere is the one of the order can you guys help me with that #stack-logstash [#stack-elasticsearch]
(https://elasticstack.slack.com/archives/CNTP6NLTZ)
i have done it with ruby to generate same has and it is working but it does not make sense that why fingerprint is not doing
THis is the first data recorded Order in real test data
"items":[{"name":"657227000506","displayName":"Essentia Purified Water, Ionized Hydration 50.7 fl oz (1 qt 1 pt 2.7 fl oz) 1.5 l","qbName":"","type":"Beverages","subType":"Beverages","upc":"657227000506",
this is the second order in same test data
"items":[{"name":"657227000506","displayName":"Essentia Purified Water, Ionized Hydration 50.7 fl oz (1 qt 1 pt 2.7 fl oz) 1.5 l","qbName":"","type":"Beverages","subType":"Beverages","upc":"657227000506",
Here is the code
if [items][selectedModifiersCombined] {
fingerprint {
source => ["[items][upc]","[items][selectedModifiersCombined]"]
target => "fingerprint"
method => "SHA1"
concatenate_all_fields => true
}
} else {
fingerprint {
source => ["[items][upc]","[items][displayName]"]
target => "fingerprint"
method => "SHA1"
concatenate_all_fields => true
}
}
Here is the output of that using that code
now i here is the ruby code that i have used it's working but i wonder why logstash fingerprint not working