Dashboards & Visualizations

Why does dark theme switch fail when using emojis in the dashboard?

D2SI
Communicator

Hello there!

I am working on a App I am willing to publish on Splunkbase.

I do like the dark mode one click feature so I try to adapt CSS colors based on currently applied theme, so that users will be able to pick dark theme without having light colors left on the dashboard.

It is working fine so far using a background rest search that checks for dashboard's theme and tokens.

However, I do use emojis in my dashboards and I have discovered that it makes the dark mode switch fail:

screen4.png

It might be a core issue so I guess I will have to live with it but I am posting there just in case anyone figured this out, maybe there is a way to escape / protect emoji or the like.

 

 

<dashboard theme="dark">
  <label>Emoji Dark Mode</label>
  <row>
    <panel>
      <html>
        
      </html>
    </panel>
  </row>
</dashboard>

 

 

PS: Code renderer also seems to dislike emojis but there is one one emoji within html :

<html>
😐
</html>

 

 

Labels (3)
0 Karma
1 Solution

niketn
Legend

@D2SI this is a known issue with Unicode Characters, with easy workaround 😂

2020-07-20	SPL-192213	Dark mode does not get applied to XML dashboards when using unicode characters like smiley icons

Workaround:
Do not use unicode characters in Dashboards with dark mode.

In case you want to use icons go for Simple XML JS extension or use standard icon libraries like  Font-Awesome: https://fontawesome.com/

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

blablabla
Path Finder

This bug also happens (on Splunk Enterprise 8.2.3.3) when using a XML Declaration like

<?xml version="1.0" encoding="UTF-8"?>

Took us a while to figure this out

0 Karma

andrewtrobec
Motivator

Came across this problem too.  No issues in 7.3.x, after upgrade to 8.0.5 it started failing.  I guess it's a regression.

0 Karma

D2SI
Communicator

Nice workaround indeed 😂

0 Karma

niketn
Legend

@D2SI this is a known issue with Unicode Characters, with easy workaround 😂

2020-07-20	SPL-192213	Dark mode does not get applied to XML dashboards when using unicode characters like smiley icons

Workaround:
Do not use unicode characters in Dashboards with dark mode.

In case you want to use icons go for Simple XML JS extension or use standard icon libraries like  Font-Awesome: https://fontawesome.com/

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

robtun1
Explorer

managed by luck to find a workaround for this. 

0 Karma

andrewtrobec
Motivator

Splunk: "yeah, don't do that" 

Tags (1)
0 Karma

robtun1
Explorer

Saw this and managed to create a workaround because I didnt like the cursor moving etc.

 

So I wrapped the function within a search macro and now the dark theme also works when you call the macro instead of having emojio embedded into your dashboard! 

 

e.g. 

eval $arg1$=case($arg1$==1,"🥇",$arg1$==2,"🥈",$arg1$==3,"🥉",1==1,$arg1$)

 

robtun1_0-1691052834679.png

 

andrewtrobec
Motivator

This works for me too, nice one! @D2SI I would suggest this being the solution.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...