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!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...