Splunk Search

Why does Xyseries drop duplicates?

Veeru
Path Finder

index=a host="b" source="0*_R_S_C_ajf" OWNER=dw*
|eval ODate=strptime(ODATE,"%Y%m%d")
|eval ODATE=strftime(ODate,"%Y-%m-%d")
| eval TWIN_ID=substr(JOBNAME,7,2)
|search ODATE="2022-07-13" TWIN_ID="CH"
| xyseries TWIN_ID STATUS APPLIC
|fillnull value="0"
when i select TWIN_ID="CH" it is showing 3 counts but actuall count is 73.I think xyseries is removing duplicates can you please me on this
my output is

 
TWIN_ID N VALUE Y
CH DW_tz DW_l6 DW_1b
cH 0 0 rs_rc
ch 0 DW_dwscd DW_dwscd

i also tried alternate with chart over 
index=a host="b" source="0*_R_S_C_ajf" OWNER=dw*
|eval ODate=strptime(ODATE,"%Y%m%d")
|eval ODATE=strftime(ODate,"%Y-%m-%d")
| eval TWIN_ID=substr(JOBNAME,7,2)
| chart values(APPLIC) as APPLIC over TWIN_ID by STATUS
|mvexpand N
|fillnull value="0"
MYOUTPUT

Thank you in advance
Labels (2)
Tags (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try list rather than values

index=a host="b" source="0*_R_S_C_ajf" OWNER=dw*
|eval ODate=strptime(ODATE,"%Y%m%d")
|eval ODATE=strftime(ODate,"%Y-%m-%d")
| eval TWIN_ID=substr(JOBNAME,7,2)
| chart list(APPLIC) as APPLIC over TWIN_ID by STATUS
|mvexpand N
|fillnull value="0"
0 Karma

Veeru
Path Finder

Hello @ITWhisperer 

Thanks for reply

I tried the list but still i am getting duplicates

TWIN_ID N VALUE Y

CH
DW_i6
DW_dx
DW_bp
DW_o9
DW_sb
DW_tz
DW_o6
DW_tz
DW_ed
DW_h6
DW_zp
DW_bl
DW_c1
DW_v2
DW_zp
DW_o4
DW_o3
DW_o5
DW_ed
DW_ed
DW_zp
DW_w6
DW_d6
DW_ec
DW_t6
DW_eb
DW_t1
DW_d6
DW_w6
 
DW_v2

 when to mv expand of Y N VALUES I am getting duplicates

CHDW_tzDW_e2DW_t4
CHDW_tzDW_v2DW_t4
CHDW_tzDW_zpDW_t4
CHDW_tzDW_e2DW_t4
CHDW_tzDW_g1DW_t4
CHDW_tzDW_dxDW_t4
CHDW_tzDW_o5DW_t4
CHDW_tzDW_c5DW_t4
CHDW_tzDW_o3DW_t4
 
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Correct - mvexpand works on one field at a time, all other fields are duplicated for each value in the mv-field

If you use mvexpand on multiple fields you will get a cross-product of the events.

Perhaps it would be clear if you give an example of your events and what you expect your result to be

Veeru
Path Finder

Hello @ITWhisperer 

Thanks for reply.
what i got  the results

CH
DW_i6
DW_dx
DW_bp
DW_o9
DW_sb
DW_tz
DW_o6
DW_tz
DW_ed
DW_h6
DW_zp
DW_bl
DW_c1
DW_v2
DW_zp
DW_o4
DW_o3
DW_o5
DW_ed
DW_ed
DW_zp
DW_w6
DW_d6
DW_ec
DW_t6
DW_eb
DW_t1
DW_d6
DW_w6
 
DW_v2

what i except  output is

TWIN_IDYVALUEN
CHDW_i6DW_zp0
CHDW_dxDW_h6DW_2
CH
DW_bp
DW_ed0
cHDW_o9DW_blDW_3
chDW_sbDW_c10

 

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Xyseries only spreads values around. If  you want aggregation use stats.

<...>
| stats count(APPLIC) AS APPLIC by TWIN_ID STATUS
| xyseries TWIN_ID STATUS APPLIC

Veeru
Path Finder

MYOUTPUT

TWIN_IDYN
CHDDW1
DW2
DWacd
CHDw2DW1
DW2
DWacd
cH0DWacd
chDwad0
0 Karma
Get Updates on the Splunk Community!

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...