I have configured logstash filter as follows. But following filed "NFC_APP_TYPE" (newly added filed by using a if condition) doesn't appear in Kibana dash board
filter{
.........
if [AppCode] == "505050" {
mutate {add_field => [ "NFC_APP_TYPE", "SEMA" ]}
}else if [AppCode] == "404040" {
mutate {add_field => [ "NFC_APP_TYPE", "TRAVEL WP" ]}
}else{
}
}
But filed called AppCode appears as following picture
Following is my pattern. This 'AppCode' filed is defined under keyvalue named as %{GREEDYDATA:nfckeyvalues}
%{EXIM_DATE:NFC_POS_TIME}%{SPACE}%{NOTSPACE}%{SPACE}%{NOTSPACE}%{SPACE}%{NOTSPACE}%{SPACE}%{NOTSPACE}%{SPACE}%{WORD}=%{INT:POS}%{NOTSPACE:RES}=%{INT},%{SPACE}%{GREEDYDATA:nfckeyvalues}
sample log:
2017-10-18 00:14:10,861 [queueJobSchedulerPrivate_Worker-23] INFO TICKET_INFO - POS=80019642|RECIVED_TO_QUEUE|message=PRIVATE|LastTckSerialHeader=196420214628, ResponseBMCode=TX_SUCCESS, LastTktRefNo=214561, TransactionType=6, TransactionSubType=0, PinReq=0, Pin=0, CvcReq=0, Cvc=0, AppCode=505050, CompanyId=1, SubAppId=0, Amount=10.0, PreBal=1483.5, PostBal=1473.5, StartLoc=1, EndLoc=2, PosTrnxTime=2017-10-17 18:15:54, IsNFC=1, TckSerial=196420214561, TckCountFull=1, TckCountHalf=0, TckCountLug=0, RouteDbId=956, TripDirection=1, TripId=3843, CardType=1, WayBillNo=0, Status=1, MerchantNo=00002495, ResponseTGCode=0, ResponseTGDesc=NO, ResponseCMSCode=8, ResponseCMSDesc=POS is not registered in the CMS, ResponseBMDesc=Duplicate Entry found, ResponseNBCode=0, ResponseNBDesc=null, TransactionID=36571948, MessageRecievedTime=2017-10-17 19:24:07, TimeDif=0, LastUpdateDate=2017-10-18 00:14:10, HeaderStatus=4, MessageSentTime=2017-10-18 00:14:08.0, EntCodeHeader=null, AppCodeHeader=505050, PosCodeHeader=80019642, PosTypeHeader=0, TnxTypeHeader=6, TxnNumHeader=null, IsNFCHeader=0, TxnTimeHeader=2017-10-17 19:23:56.0, RecCountHeader=35, FieldCountHeader=0, IsOnline=0, Did=7720171140, Uid=0469700A494380, ErrorCount=2, errCode=0, refCode=null